AutoHideとの連携を強化
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1269 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
048135ef54
commit
84b3e71d7e
@ -16,7 +16,8 @@ tab[treestyletab-drop-position] .treestyletab-drop-marker {
|
||||
}
|
||||
|
||||
tab[treestyletab-collapsed="true"],
|
||||
.tabbrowser-strip[collapsed="true"]+splitter {
|
||||
.tabbrowser-strip[collapsed="true"]+splitter,
|
||||
#appcontent[ahFull="true"] .tabbrowser-strip[ahHIDE="true"]+splitter /* AutoHide */ {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
@ -29,6 +30,12 @@ tabbrowser[treestyletab-vertical="true"] .tab-drop-indicator-bar
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* to modify browser's margin-left/margin-right dynamically */
|
||||
#appcontent {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
tabbrowser[treestyletab-vertical="true"] > tabbox {
|
||||
-moz-box-orient: horizontal !important;
|
||||
}
|
||||
|
@ -823,6 +823,105 @@ catch(e) {
|
||||
}
|
||||
|
||||
if ('autoHIDE' in window) {
|
||||
eval('autoHIDE.ShowMenu = '+
|
||||
autoHIDE.ShowMenu.toSource().replace(
|
||||
'{',
|
||||
'{ var treeStyleTabPos = TreeStyleTabService.getPref("extensions.treestyletab.tabbar.position");'
|
||||
).replace(
|
||||
'e.screenY <= autoHIDE.Win.boxObject.screenY + autoHIDE.space',
|
||||
<><![CDATA[(e.screenY <= autoHIDE.Win.boxObject.screenY + autoHIDE.space ||
|
||||
(
|
||||
treeStyleTabPos == 'left' ?
|
||||
(e.screenX <= autoHIDE.Win.boxObject.screenX + autoHIDE.space) :
|
||||
treeStyleTabPos == 'right' ?
|
||||
(e.screenX >= autoHIDE.Win.boxObject.screenX + autoHIDE.Win.boxObject.width - autoHIDE.space) :
|
||||
treeStyleTabPos == 'bottom' ?
|
||||
(e.screenY >= autoHIDE.Win.boxObject.screenY + autoHIDE.Win.boxObject.height - autoHIDE.space) :
|
||||
false
|
||||
))]]></>
|
||||
).replace(
|
||||
'e.screenY > getBrowser().mCurrentBrowser.boxObject.screenY + 25',
|
||||
<><![CDATA[(e.screenY > getBrowser().mCurrentBrowser.boxObject.screenY + 25 &&
|
||||
(
|
||||
treeStyleTabPos == 'left' ?
|
||||
(e.screenX > getBrowser().mCurrentBrowser.boxObject.screenX + 25) :
|
||||
treeStyleTabPos == 'right' ?
|
||||
(e.screenX < getBrowser().mCurrentBrowser.boxObject.screenX + getBrowser().mCurrentBrowser.boxObject.width - 25) :
|
||||
treeStyleTabPos == 'bottom' ?
|
||||
(e.screenY < getBrowser().mCurrentBrowser.boxObject.screenY + getBrowser().mCurrentBrowser.boxObject.height - 25) :
|
||||
true
|
||||
))]]></>
|
||||
)
|
||||
);
|
||||
eval('autoHIDE.HideToolbar = '+
|
||||
autoHIDE.HideToolbar.toSource().replace(
|
||||
'if (this.Show) {',
|
||||
<><![CDATA[
|
||||
var treeStyleTabPos = TreeStyleTabService.getPref("extensions.treestyletab.tabbar.position");
|
||||
if (this.Show) {
|
||||
var appcontent = document.getElementById('appcontent');
|
||||
if (appcontent.__treestyletab__resized) {
|
||||
appcontent.__treestyletab__resized = false;
|
||||
appcontent.style.marginLeft = 0;
|
||||
appcontent.style.marginRight = 0;
|
||||
}
|
||||
]]></>
|
||||
)
|
||||
);
|
||||
eval('autoHIDE.EndFull = '+
|
||||
autoHIDE.EndFull.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[
|
||||
{
|
||||
var appcontent = document.getElementById('appcontent');
|
||||
if (appcontent.__treestyletab__resized) {
|
||||
appcontent.__treestyletab__resized = false;
|
||||
appcontent.style.marginLeft = 0;
|
||||
appcontent.style.marginRight = 0;
|
||||
}
|
||||
]]></>
|
||||
)
|
||||
);
|
||||
eval('autoHIDE.SetMenu = '+
|
||||
autoHIDE.SetMenu.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[
|
||||
{
|
||||
if (arguments.length && arguments[0]) {
|
||||
var treeStyleTabSplitter = document.getAnonymousElementByAttribute(gBrowser, 'class', TreeStyleTabService.kSPLITTER);
|
||||
this.__treestyletab__tabBarWidth = gBrowser.mStrip.boxObject.width +
|
||||
(treeStyleTabSplitter ? treeStyleTabSplitter.boxObject.width : 0 );
|
||||
}
|
||||
]]></>
|
||||
)
|
||||
);
|
||||
eval('autoHIDE.MoveC = '+
|
||||
autoHIDE.MoveC.toSource().replace(
|
||||
'{',
|
||||
<><![CDATA[
|
||||
{
|
||||
var treeStyleTabPos = TreeStyleTabService.getPref("extensions.treestyletab.tabbar.position");
|
||||
if (!arguments.length) {
|
||||
var appcontent = document.getElementById('appcontent');
|
||||
if (treeStyleTabPos == 'left' &&
|
||||
!appcontent.__treestyletab__resized) {
|
||||
appcontent.style.marginRight = '-'+autoHIDE.__treestyletab__tabBarWidth+'px';
|
||||
appcontent.__treestyletab__resized = true;
|
||||
}
|
||||
else if (treeStyleTabPos == 'right' &&
|
||||
!appcontent.__treestyletab__resized) {
|
||||
appcontent.style.marginLeft = '-'+autoHIDE.__treestyletab__tabBarWidth+'px';
|
||||
appcontent.__treestyletab__resized = true;
|
||||
}
|
||||
window.setTimeout('autoHIDE.MoveC(true);', 100);
|
||||
return;
|
||||
}
|
||||
]]></>
|
||||
).replace(
|
||||
'.move(0, - this.delta)',
|
||||
'.move((treeStyleTabPos == "left" ? -this.__treestyletab__tabBarWidth : 0 ), -this.delta)'
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user