diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 107c466c..4780c73a 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1608,11 +1608,15 @@ catch(e) { var max = tabs.length; if (!max) return; + b.__treestyletab__closedTabsNum = max; if ( max > 1 && - !b.warnAboutClosingTabs(true, max) - ) + !b.warnAboutClosingTabs(true) + ) { + b.__treestyletab__closedTabsNum = 0; return; + } + b.__treestyletab__closedTabsNum = 0; for (var i = tabs.length-1; i > -1; i--) { diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 179607f7..d9807773 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -397,6 +397,12 @@ TreeStyleTabBrowser.prototype = { ) ); + eval('b.warnAboutClosingTabs = '+ + b.warnAboutClosingTabs.toSource().replace( + 'var numTabs = ', 'var numTabs = this.__treestyletab__closedTabsNum || ' + ) + ); + var tabs = b.mTabContainer.childNodes; for (var i = 0, maxi = tabs.length; i < maxi; i++) {