From fe7b51be74233c595e52aa1ed0795b8ca1e6035b Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 25 Dec 2009 16:56:45 +0000 Subject: [PATCH] cosmetic git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5625 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- modules/utils.js | 76 ++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/modules/utils.js b/modules/utils.js index b7fe3fb7..74f19662 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -46,6 +46,44 @@ var TreeStyleTabUtils = { }, _initialized : false, +// tabbar position + + 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; + }, + + rollbackTabbarPosition : function TSTUtils_rollbackTabbarPosition() /* PUBLIC API */ + { + if (!this._tabbarPositionHistory.length) + return false; + + this._inRollbackTabbarPosition = true; + this.currentTabbarPosition = this._tabbarPositionHistory.pop(); + this._inRollbackTabbarPosition = false; + + return true; + }, + + onChangeTabbarPosition : function TSTUtils_onChangeTabbarPosition(aPosition) + { + if (this._inRollbackTabbarPosition) return; + this._tabbarPositionHistory.push(aPosition); + }, + + _tabbarPositionHistory : [], + // pref listener domains : [ @@ -76,44 +114,6 @@ var TreeStyleTabUtils = { } }, -// tabbar position - - get currentTabbarPosition() /* PUBLIC API */ - { - return this.getPref('extensions.treestyletab.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.setPref('extensions.treestyletab.tabbar.position', position); - - return aValue; - }, - - rollbackTabbarPosition : function TSTUtils_rollbackTabbarPosition() /* PUBLIC API */ - { - if (!this._tabbarPositionHistory.length) - return false; - - this._inRollbackTabbarPosition = true; - this.currentTabbarPosition = this._tabbarPositionHistory.pop(); - this._inRollbackTabbarPosition = false; - - return true; - }, - - onChangeTabbarPosition : function TSTUtils_onChangeTabbarPosition(aPosition) - { - if (this._inRollbackTabbarPosition) return; - this._tabbarPositionHistory.push(aPosition); - }, - - _tabbarPositionHistory : [], - /* Save/Load Prefs */ getTreePref : function TSTUtils_getTreePref(aPrefstring)