Bug 1276904 - container-icon visibility should follow the selectedBrowser, r=gijs

This commit is contained in:
Andrea Marchesini 2016-05-31 15:34:49 +02:00
parent 5ec1e29d9a
commit a63c7e4ee3
2 changed files with 9 additions and 4 deletions

View File

@ -4069,11 +4069,11 @@ function updateUserContextUIVisibility()
/** /**
* Updates the User Context UI indicators if the browser is in a non-default context * Updates the User Context UI indicators if the browser is in a non-default context
*/ */
function updateUserContextUIIndicator(browser) function updateUserContextUIIndicator()
{ {
let hbox = document.getElementById("userContext-icons"); let hbox = document.getElementById("userContext-icons");
let userContextId = browser.getAttribute("usercontextid"); let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid");
if (!userContextId) { if (!userContextId) {
hbox.hidden = true; hbox.hidden = true;
return; return;

View File

@ -1217,7 +1217,7 @@
this._adjustFocusAfterTabSwitch(this.mCurrentTab); this._adjustFocusAfterTabSwitch(this.mCurrentTab);
} }
updateUserContextUIIndicator(gBrowser.selectedBrowser); updateUserContextUIIndicator();
this.tabContainer._setPositionalAttributes(); this.tabContainer._setPositionalAttributes();
@ -4328,7 +4328,12 @@
tab.setUserContextId(data.userContextId); tab.setUserContextId(data.userContextId);
} }
updateUserContextUIIndicator(browser); // We don't want to update the container icon and identifier if
// this is not the selected browser.
if (browser == gBrowser.selectedBrowser) {
updateUserContextUIIndicator();
}
break; break;
} }
case "Findbar:Keypress": { case "Findbar:Keypress": {