Bug 1273094 - only trigger TabsInTitlebar.init() after the tabbrowser has updated the visibility of the tabs toolbar, r=mikedeboer

MozReview-Commit-ID: 2NOPYqbq4Zp

--HG--
extra : rebase_source : fcafa79a232d994ad56e73539134a2f01934a210
extra : amend_source : 42aad7336111e104b44c2286932bbbf409db5914
This commit is contained in:
Gijs Kruitbosch 2016-05-17 17:18:55 +01:00
parent 1ba465d13d
commit df7777aa11
3 changed files with 8 additions and 2 deletions

View File

@ -8,6 +8,9 @@
var TabsInTitlebar = {
init: function () {
if (this._initialized) {
return;
}
this._readPref();
Services.prefs.addObserver(this._prefName, this, false);

View File

@ -990,7 +990,6 @@ var gBrowserInit = {
TabletModeUpdater.init();
CombinedStopReload.init();
gPrivateBrowsingUI.init();
TabsInTitlebar.init();
if (window.matchMedia("(-moz-os-version: windows-win8)").matches &&
window.matchMedia("(-moz-windows-default-theme)").matches) {
@ -5099,12 +5098,15 @@ var TabletModeUpdater = {
},
update(isInTabletMode) {
let wasInTabletMode = document.documentElement.hasAttribute("tabletmode");
if (isInTabletMode) {
document.documentElement.setAttribute("tabletmode", "true");
} else {
document.documentElement.removeAttribute("tabletmode");
}
TabsInTitlebar.updateAppearance(true);
if (wasInTabletMode != isInTabletMode) {
TabsInTitlebar.updateAppearance(true);
}
},
};

View File

@ -5364,6 +5364,7 @@
switch (aEvent.type) {
case "load":
this.updateVisibility();
TabsInTitlebar.init();
break;
case "resize":
if (aEvent.target != window)