Bug 1476901 - Stop ever hiding editBookmarkPanelContent and editBookmarkPanelBottomButtons in the bookmark panel. r?mak draft
authorDão Gottwald <dao@mozilla.com>
Thu, 19 Jul 2018 13:43:30 +0200
changeset 820277 08c99d6d9adf54525f442d45c89cb33281e553e5
parent 820131 5a8107262015714d2907a85abc24c847ad9b32d2
push id116781
push userdgottwald@mozilla.com
push dateThu, 19 Jul 2018 11:44:10 +0000
reviewersmak
bugs1476901
milestone63.0a1
Bug 1476901 - Stop ever hiding editBookmarkPanelContent and editBookmarkPanelBottomButtons in the bookmark panel. r?mak MozReview-Commit-ID: CwfHapJicIG
browser/base/content/browser-places.js
browser/base/content/browser.xul
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -57,23 +57,18 @@ var StarUI = {
       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;
       case "popuphidden": {
         clearTimeout(this._autoCloseTimer);
         if (aEvent.originalTarget == this.panel) {
-          let selectedFolderGuid;
-
-          if (!this._element("editBookmarkPanelContent").hidden) {
-            // Get the folder first, before we uninit the overlay.
-            selectedFolderGuid = gEditItemOverlay.selectedFolderGuid;
-            this.quitEditMode();
-          }
+          let selectedFolderGuid = gEditItemOverlay.selectedFolderGuid;
+          gEditItemOverlay.uninitPanel(true);
 
           this._anchorElement.removeAttribute("open");
           this._anchorElement = null;
 
           let removeBookmarksOnPopupHidden = this._removeBookmarksOnPopupHidden;
           this._removeBookmarksOnPopupHidden = false;
           let guidsForRemoval = this._itemGuids;
           this._itemGuids = null;
@@ -200,19 +195,16 @@ var StarUI = {
     this._element("editBookmarkPanelTitle").value =
       this._isNewBookmark ?
         gNavigatorBundle.getString("editBookmarkPanel.newBookmarkTitle") :
         gNavigatorBundle.getString("editBookmarkPanel.editBookmarkTitle");
 
     this._element("editBookmarkPanel_showForNewBookmarks").checked =
       this.showForNewBookmarks;
 
-    this._element("editBookmarkPanelBottomButtons").hidden = false;
-    this._element("editBookmarkPanelContent").hidden = false;
-
     this._itemGuids = [];
     await PlacesUtils.bookmarks.fetch({url: aUrl},
       bookmark => this._itemGuids.push(bookmark.guid));
 
     let removeButton = this._element("editBookmarkPanelRemoveButton");
     if (this._isNewBookmark) {
       removeButton.label = gNavigatorBundle.getString("editBookmarkPanel.cancel.label");
       removeButton.setAttribute("accesskey",
@@ -268,33 +260,16 @@ var StarUI = {
       faviconImage.setAttribute("src", tab.getAttribute("image"));
     }
 
     let canvas = PageThumbs.createCanvas(window);
     PageThumbs.captureToCanvas(gBrowser.selectedBrowser, canvas);
     document.mozSetImageElement("editBookmarkPanelImageCanvas", canvas);
   },
 
-  panelShown:
-  function SU_panelShown(aEvent) {
-    if (aEvent.target == this.panel) {
-      if (this._element("editBookmarkPanelContent").hidden) {
-        // Note this isn't actually used anymore, we should remove this
-        // once we decide not to bring back the page bookmarked notification
-        this.panel.focus();
-      }
-    }
-  },
-
-  quitEditMode: function SU_quitEditMode() {
-    this._element("editBookmarkPanelContent").hidden = true;
-    this._element("editBookmarkPanelBottomButtons").hidden = true;
-    gEditItemOverlay.uninitPanel(true);
-  },
-
   removeBookmarkButtonCommand: function SU_removeBookmarkButtonCommand() {
     this._removeBookmarksOnPopupHidden = true;
     this.panel.hidePopup();
   },
 
   // Matching the way it is used in the Library, editBookmarkOverlay implements
   // an instant-apply UI, having no batched-Undo/Redo support.
   // However, in this context (the Star UI) we have a Cancel button whose
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -227,17 +227,16 @@
     </panel>
 
     <panel id="editBookmarkPanel"
            type="arrow"
            orient="vertical"
            ignorekeys="true"
            hidden="true"
            tabspecific="true"
-           onpopupshown="StarUI.panelShown(event);"
            aria-labelledby="editBookmarkPanelTitle">
       <box class="panel-header">
         <label id="editBookmarkPanelTitle"/>
       </box>
       <html:div id="editBookmarkPanelFaviconContainer">
         <html:img id="editBookmarkPanelFavicon"/>
       </html:div>
       <box id="editBookmarkPanelImage"/>