Bug 1476901 - Stop ever hiding editBookmarkPanelContent and editBookmarkPanelBottomButtons in the bookmark panel. r=mak
authorDão Gottwald <dao@mozilla.com>
Thu, 19 Jul 2018 13:43:30 +0200
changeset 427457 ab6c2651f8eff6b2846ee89732089c9ca62f6a13
parent 427456 b2f2361ee3175a867335952705274d8d08cc086f
child 427458 2aca3a665afe56e1480c2358c8b9d3047cbbdc32
push id34306
push usercsabou@mozilla.com
push dateFri, 20 Jul 2018 21:41:18 +0000
treeherdermozilla-central@d6a5e8aea651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1476901
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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"/>