Bug 1360282 - Remove _setVisibility helper now that the sidebar is always shown through show();r=Gijs
MozReview-Commit-ID: FWJshLtYZ3h
--- a/browser/base/content/browser-sidebar.js
+++ b/browser/base/content/browser-sidebar.js
@@ -253,29 +253,16 @@ var SidebarUI = {
return this._title.value;
},
set title(value) {
this._title.value = value;
},
/**
- * Internal helper to show/hide the box and splitter elements.
- *
- * @param {bool} visible
- */
- _setVisibility(visible) {
- this._box.hidden = !visible;
- this._splitter.hidden = !visible;
- if (visible) {
- this.setPosition();
- }
- },
-
- /**
* Toggle the visibility of the sidebar. If the sidebar is hidden or is open
* with a different commandID, then the sidebar will be opened using the
* specified commandID. Otherwise the sidebar will be hidden.
*
* @param {string} commandID ID of the xul:broadcaster element to use.
* @return {Promise}
*/
toggle(commandID = this.currentID) {
@@ -322,17 +309,18 @@ var SidebarUI = {
for (let broadcaster of broadcasters) {
if (broadcaster != sidebarBroadcaster) {
broadcaster.removeAttribute("checked");
} else {
sidebarBroadcaster.setAttribute("checked", "true");
}
}
- this._setVisibility(true);
+ this._box.hidden = this._splitter.hidden = false;
+ this.setPosition();
this.hideSwitcherPanel();
this._box.setAttribute("sidebarcommand", sidebarBroadcaster.id);
this.lastOpenedId = sidebarBroadcaster.id;
let title = sidebarBroadcaster.getAttribute("sidebartitle") ||
sidebarBroadcaster.getAttribute("label");
@@ -396,17 +384,17 @@ var SidebarUI = {
// until about:blank has loaded (which does not happen as long as the
// element is hidden).
this.browser.setAttribute("src", "about:blank");
this.browser.docShell.createAboutBlankContentViewer(null);
sidebarBroadcaster.removeAttribute("checked");
this._box.setAttribute("sidebarcommand", "");
this._title.value = "";
- this._setVisibility(false);
+ this._box.hidden = this._splitter.hidden = true;
let selBrowser = gBrowser.selectedBrowser;
selBrowser.focus();
selBrowser.messageManager.sendAsyncMessage("Sidebar:VisibilityChange",
{commandID, isOpen: false}
);
BrowserUITelemetry.countSidebarEvent(commandID, "hide");
},