Bug 1468077 - Stop disabling cmd_close and cmd_closeWindow in the bookmark panel since it seems to be half-broken and is inconsistent with other panels. r?mak
MozReview-Commit-ID: AkKaq5Kon77
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -42,45 +42,16 @@ var StarUI = {
element.addEventListener("compositionstart", this);
element.addEventListener("compositionend", this);
element.addEventListener("input", this);
element.addEventListener("popuphidden", this);
element.addEventListener("popupshown", this);
return this.panel = element;
},
- // Array of command elements to disable when the panel is opened.
- get _blockedCommands() {
- delete this._blockedCommands;
- return this._blockedCommands =
- ["cmd_close", "cmd_closeWindow"].map(id => this._element(id));
- },
-
- _blockCommands: function SU__blockCommands() {
- this._blockedCommands.forEach(function(elt) {
- // make sure not to permanently disable this item (see bug 409155)
- if (elt.hasAttribute("wasDisabled"))
- return;
- if (elt.getAttribute("disabled") == "true") {
- elt.setAttribute("wasDisabled", "true");
- } else {
- elt.setAttribute("wasDisabled", "false");
- elt.setAttribute("disabled", "true");
- }
- });
- },
-
- _restoreCommandsState: function SU__restoreCommandsState() {
- this._blockedCommands.forEach(function(elt) {
- if (elt.getAttribute("wasDisabled") != "true")
- elt.removeAttribute("disabled");
- elt.removeAttribute("wasDisabled");
- });
- },
-
// nsIDOMEventListener
handleEvent(aEvent) {
switch (aEvent.type) {
case "mousemove":
clearTimeout(this._autoCloseTimer);
// The autoclose timer is not disabled on generic mouseout
// because the user may not have actually interacted with the popup.
break;
@@ -93,17 +64,16 @@ var StarUI = {
// Get the folder first, before we uninit the overlay.
selectedFolderGuid = gEditItemOverlay.selectedFolderGuid;
this.quitEditMode();
}
this._anchorElement.removeAttribute("open");
this._anchorElement = null;
- this._restoreCommandsState();
let removeBookmarksOnPopupHidden = this._removeBookmarksOnPopupHidden;
this._removeBookmarksOnPopupHidden = false;
let guidsForRemoval = this._itemGuids;
this._itemGuids = null;
if (this._batching) {
this.endBatch();
}
@@ -219,18 +189,16 @@ var StarUI = {
// cause the panel to flicker.
if (this.panel.state != "closed") {
return;
}
this._isNewBookmark = aIsNewBookmark;
this._itemGuids = null;
- this._blockCommands(); // un-done in the popuphidden handler
-
this._element("editBookmarkPanelTitle").value =
this._isNewBookmark ?
gNavigatorBundle.getString("editBookmarkPanel.newBookmarkTitle") :
gNavigatorBundle.getString("editBookmarkPanel.editBookmarkTitle");
// No description; show the Done, Remove;
this._element("editBookmarkPanelBottomButtons").hidden = false;
this._element("editBookmarkPanelContent").hidden = false;