Bug 625778 - Contextual commands on the main menubar bookmarks menu don't work after a customization. r=adw
MozReview-Commit-ID: 8Atiql9Zplv
--- 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();