Allow to update the size of the tab bar by other addons with the nsDOMTreeStyleTabTabbarRendered event
This commit is contained in:
parent
050a87e108
commit
7e5916cce5
@ -2086,13 +2086,17 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
|
|||||||
else
|
else
|
||||||
this.positionPinnedTabsWithDelay(null, null, aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE);
|
this.positionPinnedTabsWithDelay(null, null, aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE);
|
||||||
|
|
||||||
|
this.notifyingRenderedEvent = true;
|
||||||
var event = d.createEvent('Events');
|
var event = d.createEvent('Events');
|
||||||
event.initEvent(this.kEVENT_TYPE_TABBAR_RENDERED, true, false);
|
event.initEvent(this.kEVENT_TYPE_TABBAR_RENDERED, true, false);
|
||||||
this.mTabBrowser.tabContainer.dispatchEvent(event);
|
this.mTabBrowser.tabContainer.dispatchEvent(event);
|
||||||
|
|
||||||
if (!collapsed && aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE)
|
|
||||||
setTimeout((function() {
|
setTimeout((function() {
|
||||||
if (this.browser) // ignore calling after destroyed...
|
this.notifyingRenderedEvent = false;
|
||||||
|
|
||||||
|
if (!collapsed &&
|
||||||
|
aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE &&
|
||||||
|
this.browser) // ignore calling after destroyed...
|
||||||
this.scrollToTab(this.browser.selectedTab);
|
this.scrollToTab(this.browser.selectedTab);
|
||||||
}).bind(this), 0);
|
}).bind(this), 0);
|
||||||
},
|
},
|
||||||
|
@ -105,7 +105,9 @@ BrowserUIShowHideObserver.prototype = {
|
|||||||
|
|
||||||
onAttributeModified : function BrowserUIShowHideObserver_onAttributeModified(aMutation, aObserver)
|
onAttributeModified : function BrowserUIShowHideObserver_onAttributeModified(aMutation, aObserver)
|
||||||
{
|
{
|
||||||
if (this.handlingAttrChange)
|
var TST = this.owner.browser.treeStyleTab;
|
||||||
|
if (this.handlingAttrChange ||
|
||||||
|
TST.notifyingRenderedEvent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var target = aMutation.target;
|
var target = aMutation.target;
|
||||||
@ -113,7 +115,6 @@ BrowserUIShowHideObserver.prototype = {
|
|||||||
if (target.__treestyletab_mutationObserver_lastState == state)
|
if (target.__treestyletab_mutationObserver_lastState == state)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var TST = this.owner.browser.treeStyleTab;
|
|
||||||
if (
|
if (
|
||||||
// ignore modifications of each tab
|
// ignore modifications of each tab
|
||||||
TST.getTabFromChild(target) ||
|
TST.getTabFromChild(target) ||
|
||||||
|
@ -84,6 +84,7 @@ FullscreenObserver.prototype = {
|
|||||||
onSizeModeChange : function FullscreenObserver_onSizeModeChange()
|
onSizeModeChange : function FullscreenObserver_onSizeModeChange()
|
||||||
{
|
{
|
||||||
this.updateToolboxPosition();
|
this.updateToolboxPosition();
|
||||||
|
if (!this.window.gBrowser.treeStyleTab.notifyingRenderedEvent)
|
||||||
this.window.gBrowser.treeStyleTab.updateFloatingTabbar(TreeStyleTabConstants.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
|
this.window.gBrowser.treeStyleTab.updateFloatingTabbar(TreeStyleTabConstants.kTABBAR_UPDATE_BY_WINDOW_RESIZE);
|
||||||
},
|
},
|
||||||
updateToolboxPosition : function FullscreenObserver_onSizeModeChange()
|
updateToolboxPosition : function FullscreenObserver_onSizeModeChange()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user