Firefox 3.5以降でタブバーのスプリッタのgrippyをクリックすると正しくタブバーの幅・高さがトグルしない(折りたたまれた状態の幅・高さを記憶してしまっていた)問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5104 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-09-08 09:59:23 +00:00
parent 963e32c913
commit 528ccd99b5
2 changed files with 24 additions and 9 deletions

View File

@ -2173,15 +2173,29 @@ catch(e) {
onTabbarResized : function(aEvent)
{
var b = this.getTabBrowserFromChild(aEvent.currentTarget);
window.setTimeout(function(aSelf) {
if (!b.treeStyleTab.clickedOnTabbarResizerGrippy) {
if (!b.treeStyleTab.isVertical) {
this.setTreePref('tabbar.height', b.mStrip.boxObject.height);
aSelf.setTreePref('tabbar.height', b.mStrip.boxObject.height);
}
else {
if (!b.treeStyleTab.autoHide.expanded)
this.setTreePref('tabbar.shrunkenWidth', b.mStrip.boxObject.width);
aSelf.setTreePref('tabbar.shrunkenWidth', b.mStrip.boxObject.width);
else
this.setTreePref('tabbar.width', b.mStrip.boxObject.width);
aSelf.setTreePref('tabbar.width', b.mStrip.boxObject.width);
}
}
b.treeStyleTab.clickedOnTabbarResizerGrippy = false;
}, 10, this);
},
onTabbarResizerClick : function(aEvent)
{
var b = this.getTabBrowserFromChild(aEvent.currentTarget);
b.treeStyleTab.clickedOnTabbarResizerGrippy = this.evaluateXPath(
'ancestor-or-self::xul:grippy',
aEvent.originalTarget,
XPathResult.BOOLEAN_TYPE
).booleanValue;
},
initContextMenu : function()

View File

@ -130,6 +130,7 @@ TreeStyleTabBrowser.prototype = {
splitter = document.createElement('splitter');
splitter.setAttribute('class', this.kSPLITTER);
splitter.addEventListener('mousedown', this, true);
splitter.setAttribute('onclick', 'TreeStyleTabService.onTabbarResizerClick(event);');
splitter.setAttribute('onmouseup', 'TreeStyleTabService.onTabbarResized(event);');
splitter.setAttribute('state', 'open');
splitter.appendChild(document.createElement('grippy'));