git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5625 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-12-25 16:56:45 +00:00
parent 641d9ffc9f
commit fe7b51be74

View File

@ -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)