Bug 625778 - Contextual commands on the main menubar bookmarks menu don't work after a customization. r=adw
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 09 Jun 2017 16:15:28 +0200
changeset 411451 cad0db00e0b473bab9f7abae5b57074cd7e99865
parent 411450 158930f1c0d31038b5015cdf60221e50bebcfd89
child 411452 405e89243e0a88abf3982cddb4a2043ec3eef908
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs625778
milestone55.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 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();