Bug 625778 - Contextual commands on the main menubar bookmarks menu don't work after a customization. r=adw draft
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 09 Jun 2017 16:15:28 +0200
changeset 591725 104f490a478742971fb333e2229bf470cc42b1ef
parent 590997 6491fb29e7fcc9e02cc179ae2856f426a3552385
child 632600 75a513db02a6fcb246b3ba5b89d5e8b7107a2656
push id63148
push usermak77@bonardo.net
push dateFri, 09 Jun 2017 14:17:07 +0000
reviewersadw
bugs625778
milestone55.0a1
Bug 625778 - Contextual commands on the main menubar bookmarks menu don't work after a customization. r=adw MozReview-Commit-ID: 8Atiql9Zplv
browser/base/content/browser-places.js
--- a/browser/base/content/browser-places.js
+++ b/browser/base/content/browser-places.js
@@ -1566,16 +1566,21 @@ var BookmarkingUI = {
   },
 
   _uninitView: function BUI__uninitView() {
     // When an element with a placesView attached is removed and re-inserted,
     // XBL reapplies the binding causing any kind of issues and possible leaks,
     // so kill current view and let popupshowing generate a new one.
     if (this.button._placesView)
       this.button._placesView.uninit();
+    // Also uninit the main menubar placesView, since it would have the same
+    // issues.
+    let menubar = document.getElementById("bookmarksMenu");
+    if (menubar && menubar._placesView)
+      menubar._placesView.uninit();
 
     // We have to do the same thing for the "special" views underneath the
     // the bookmarks menu.
     const kSpecialViewNodeIDs = ["BMB_bookmarksToolbar", "BMB_unsortedBookmarks"];
     for (let viewNodeID of kSpecialViewNodeIDs) {
       let elem = document.getElementById(viewNodeID);
       if (elem && elem._placesView) {
         elem._placesView.uninit();