Bug 1424672 - stop removing the header in the recently closed places views, r?mak,paolo draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 12 Dec 2017 16:20:49 -0600
changeset 710935 10285be23d8e454fe609ed238d1f8b94a616742c
parent 710168 c35272ba2006ecc8bc10099242f7b4c5c0f805d0
child 743703 6a8a6b406074a8245171268f98a443ad034064c4
push id92953
push usergijskruitbosch@gmail.com
push dateTue, 12 Dec 2017 22:21:28 +0000
reviewersmak, paolo
bugs1424672
milestone59.0a1
Bug 1424672 - stop removing the header in the recently closed places views, r?mak,paolo MozReview-Commit-ID: J5HlyA8nxe2
browser/components/places/content/browserPlacesViews.js
--- a/browser/components/places/content/browserPlacesViews.js
+++ b/browser/components/places/content/browserPlacesViews.js
@@ -233,18 +233,23 @@ PlacesViewBase.prototype = {
     return this.controller.buildContextMenu(aPopup);
   },
 
   destroyContextMenu: function PVB_destroyContextMenu(aPopup) {
     this._contextMenuShown = null;
   },
 
   clearAllContents(aPopup) {
-    while (aPopup.firstChild) {
-      aPopup.firstChild.remove();
+    let kid = aPopup.firstChild;
+    while (kid) {
+      let next = kid.nextSibling;
+      if (!kid.classList.contains("panel-header")) {
+        kid.remove();
+      }
+      kid = next;
     }
     aPopup._emptyMenuitem = aPopup._startMarker = aPopup._endMarker = null;
   },
 
   _cleanPopup: function PVB_cleanPopup(aPopup, aDelay) {
     // Ensure markers are here when `invalidateContainer` is called before the
     // popup is shown, which may the case for panelviews, for example.
     this._ensureMarkers(aPopup);