From 7aed5e240aba8e3000db4f8e9c45a339d8de237d Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sat, 22 Jan 2011 13:43:43 +0900 Subject: [PATCH] don't update _notifyBackgroundTab twice --- content/treestyletab/treestyletabbrowser.js | 31 +++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index ffc86b11..1c93ea6f 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1063,20 +1063,23 @@ TreeStyleTabBrowser.prototype = { ); } - eval('b.mTabContainer._notifyBackgroundTab = '+ - b.mTabContainer._notifyBackgroundTab.toSource().replace( - '{', - '{ var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;' - ).replace( - /\.screenX/g, '[treeStyleTab.positionProp]' - ).replace( - /\.width/g, '[treeStyleTab.sizeProp]' - ).replace( - /\.left/g, '[treeStyleTab.startProp]' - ).replace( - /\.right/g, '[treeStyleTab.endProp]' - ) - ); + source = b.mTabContainer._notifyBackgroundTab.toSource(); + if (source.indexOf('TreeStyleTabService.getTabBrowserFromChild') < 0) { + eval('b.mTabContainer._notifyBackgroundTab = '+ + source.toSource().replace( + '{', + '{ var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;' + ).replace( + /\.screenX/g, '[treeStyleTab.positionProp]' + ).replace( + /\.width/g, '[treeStyleTab.sizeProp]' + ).replace( + /\.left/g, '[treeStyleTab.startProp]' + ).replace( + /\.right/g, '[treeStyleTab.endProp]' + ) + ); + } if (b.tabContainer && '_getDropIndex' in b.tabContainer) { // Firefox 4.0 or later eval('b.tabContainer._getDropIndex = '+