Bug 519186 - drag & drop in bookmarks menu does not correctly update the view, r=mano
This is a regression from
bug 498130.
--- a/browser/components/places/content/menu.xml
+++ b/browser/components/places/content/menu.xml
@@ -720,18 +720,17 @@
if (!parentElt._built)
return;
// parentElt is the <menu> element for the container,
// we need the <menupopup>
let popup = parentElt.firstChild;
let index = popup._startMarker + 1 + aIndex;
- let before = popup.childNodes[index] || null;
- this._self.insertNewItem(aNode, popup, before);
+ this._self.insertNewItem(aNode, popup, popup.childNodes[index]);
if (popup._emptyMenuItem)
popup._emptyMenuItem.hidden = true;
},
nodeRemoved: function PMV_nodeRemoved(aParentNode, aNode, aIndex) {
let parentElt = aParentNode._DOMElement;
NS_ASSERT(parentElt, "parent node must have _DOMElement set");
@@ -772,18 +771,19 @@
// If our root node is a folder, it might be moved. There's nothing
// we need to do in that case.
if (nodeElt == this._self.parentNode)
return;
// Move the node.
let popup = nodeElt.parentNode;
+ let index = popup._startMarker + 1 + aNewIndex;
popup.removeChild(nodeElt);
- popup.insertBefore(nodeElt, popup.childNodes[aNewIndex]);
+ popup.insertBefore(nodeElt, popup.childNodes[index]);
},
nodeTitleChanged: function PMV__nodeTitleChanged(aNode, aNewTitle) {
let nodeElt = aNode._DOMElement;
NS_ASSERT(nodeElt, "node must have _DOMElement set");
// There's no UI representation for the root node, thus there's
// nothing to be done when the title changes.