diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 01b888eb..995af1f0 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -448,19 +448,26 @@ var TreeStyleTabService = { this.setTreePref('enableSubtreeIndent.horizontal', !this.getTreePref(pref)); }, - changeTabbarPosition : function(aNewPosition) /* PUBLIC API */ + changeTabbarPosition : function(aNewPosition) /* PUBLIC API (obsolete, for backward compatibility) */ { - if (!aNewPosition || !/^(top|bottom|left|right)$/i.test(aNewPosition)) - aNewPosition = 'top'; - - aNewPosition = aNewPosition.toLowerCase(); - this.setTreePref('tabbar.position', aNewPosition); + this.currentTabbarPosition = aNewPosition; }, get currentTabbarPosition() /* PUBLIC API */ { return this.getTreePref('tabbar.position') || 'top'; }, + set currentTabbarPosition(aValue) + { + var position = String(aValue); + if (!position || !/^(top|bottom|left|right)$/i.test(position)) + position = 'top'; + + position = position.toLowerCase(); + this.setTreePref('tabbar.position', position); + + return aValue; + }, /* backward compatibility */ getTempTreeStyleTab : function(aTabBrowser) diff --git a/content/treestyletab/treestyletabbrowser_tabpanelDNDObserver.js b/content/treestyletab/treestyletabbrowser_tabpanelDNDObserver.js index 68093f58..7a5bcd70 100644 --- a/content/treestyletab/treestyletabbrowser_tabpanelDNDObserver.js +++ b/content/treestyletab/treestyletabbrowser_tabpanelDNDObserver.js @@ -34,7 +34,7 @@ TreeStyleTabBrowserTabpanelDNDObserver.prototype = { let orient = (position == 'left' || position == 'right') ? 'vertical' : 'horizontal' ; sv.setTreePref('tabbar.fixed.'+orient, false); } - sv.changeTabbarPosition(position); + sv.currentTabbarPosition = position; } aEvent.stopPropagation();