mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 734273 - tab bar sometimes shows scroll arrows with only one tab after startup. r=felipe
- delayed updateVisibility to the load event since the constructor runs earlier - added _propagatedVisibilityOnce instead of unconditionally calling _propagateVisibility after calling updateVisibility for the first time, since this needlessly propagated the visibility twice in a row with browser.tabs.autoHide = false - removed the syncUI call from TabsOnTop.init since updateVisibility takes care of this
This commit is contained in:
parent
5368eb806b
commit
24a7a36707
@ -5331,8 +5331,6 @@ function setToolbarVisibility(toolbar, isVisible) {
|
||||
|
||||
var TabsOnTop = {
|
||||
init: function TabsOnTop_init() {
|
||||
this._initialized = true;
|
||||
this.syncUI();
|
||||
Services.prefs.addObserver(this._prefName, this, false);
|
||||
},
|
||||
|
||||
@ -5345,9 +5343,6 @@ var TabsOnTop = {
|
||||
},
|
||||
|
||||
syncUI: function () {
|
||||
if (!this._initialized)
|
||||
return;
|
||||
|
||||
let userEnabled = Services.prefs.getBoolPref(this._prefName);
|
||||
let enabled = userEnabled && gBrowser.tabContainer.visible;
|
||||
|
||||
|
@ -2779,9 +2779,7 @@
|
||||
|
||||
Services.prefs.addObserver("browser.tabs.", this._prefObserver, false);
|
||||
window.addEventListener("resize", this, false);
|
||||
|
||||
this.updateVisibility();
|
||||
this._propagateVisibility();
|
||||
window.addEventListener("load", this, false);
|
||||
]]>
|
||||
</constructor>
|
||||
|
||||
@ -2841,15 +2839,19 @@
|
||||
this.parentNode && this.parentNode.localName == "toolbar" ? this.parentNode : this;
|
||||
]]></field>
|
||||
|
||||
<field name="_propagatedVisibilityOnce">false</field>
|
||||
|
||||
<property name="visible"
|
||||
onget="return !this._container.collapsed;">
|
||||
<setter><![CDATA[
|
||||
if (val == this.visible)
|
||||
if (val == this.visible &&
|
||||
this._propagatedVisibilityOnce)
|
||||
return val;
|
||||
|
||||
this._container.collapsed = !val;
|
||||
|
||||
this._propagateVisibility();
|
||||
this._propagatedVisibilityOnce = true;
|
||||
|
||||
return val;
|
||||
]]></setter>
|
||||
@ -3080,6 +3082,9 @@
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
switch (aEvent.type) {
|
||||
case "load":
|
||||
this.updateVisibility();
|
||||
break;
|
||||
case "resize":
|
||||
if (aEvent.target != window)
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user