From 7dbac04c5d906cedf0b63fe5a77f039171eb029e Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 18 Dec 2009 09:14:02 +0000 Subject: [PATCH] =?UTF-8?q?currentTabbarPosition=E3=81=ABsetter=E3=82=92?= =?UTF-8?q?=E5=AE=9A=E7=BE=A9=E3=81=97=E3=80=81=E3=81=9D=E3=81=A1=E3=82=89?= =?UTF-8?q?=E3=82=92=E6=AD=A3=E5=BC=8F=E3=81=A8=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5560 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 19 +++++++++++++------ ...treestyletabbrowser_tabpanelDNDObserver.js | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) 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();