Reposition the floating tab bar only when the sidebar is actually opened or closed

This commit is contained in:
YUKI Hiroshi 2015-11-05 18:11:28 +09:00
parent 296bae010f
commit 8bfe8dfc2e

View File

@ -336,15 +336,19 @@ var TreeStyleTabWindowHelper = {
if ('SidebarUI' in window) { // for Firefox 39 or later
SidebarUI.__treestyletab__show = SidebarUI.show;
SidebarUI.show = function(...aArgs) {
var opened = this.isOpen;
return this.__treestyletab__show.apply(this, aArgs)
.then(function(aResult) {
.then((function(aResult) {
if (opened !== this.isOpen)
gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR);
return aResult;
});
}).bind(this));
};
SidebarUI.__treestyletab__hide = SidebarUI.hide;
SidebarUI.hide = function(...aArgs) {
var opened = this.isOpen;
var retVal = this.__treestyletab__hide.apply(this, aArgs);
if (opened !== this.isOpen)
gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_TOGGLE_SIDEBAR);
return retVal;
};