Bug 1456589 - Part 1 Port Bug 1437651 [Remove unused simulated-places-node references]. r=IanN

This commit is contained in:
Frank-Rainer Grahl 2018-07-23 22:06:15 +02:00
Родитель 90668064a8
Коммит 43e92ac762
3 изменённых файлов: 6 добавлений и 14 удалений

Просмотреть файл

@ -908,8 +908,7 @@ PlacesViewBase.prototype = {
break;
}
if (child._placesNode && !child.hasAttribute("simulated-places-node") &&
!firstNonStaticNodeFound) {
if (child._placesNode && !firstNonStaticNodeFound) {
firstNonStaticNodeFound = true;
aPopup.insertBefore(aPopup._startMarker, child);
}

Просмотреть файл

@ -1410,23 +1410,16 @@ var PlacesControllerDragHelper = {
* A XUL DOM node.
* @return True if the node can be moved, false otherwise.
*/
canMoveNode(aNode, aView, aDOMNode) {
canMoveNode(aNode, aView) {
// Only bookmark items are movable.
if (aNode.itemId == -1)
return false;
let parentNode = aNode.parent;
if (!parentNode) {
// Normally parentless places nodes can not be moved,
// but simulated bookmarked URI nodes are special.
return !!aDOMNode &&
aDOMNode.hasAttribute("simulated-places-node") &&
PlacesUtils.nodeIsBookmark(aNode);
}
// Once tags and bookmarked are divorced, the tag-query check should be
// removed.
return PlacesUtils.nodeIsFolder(parentNode) &&
let parentNode = aNode.parent;
return parentNode != null &&
PlacesUtils.nodeIsFolder(parentNode) &&
!PlacesUIUtils.isFolderReadOnly(parentNode, aView) &&
!PlacesUtils.nodeIsTagQuery(parentNode);
},

Просмотреть файл

@ -350,7 +350,7 @@
// Force a copy action if parent node is a query or we are dragging a
// not-removable node.
if (!PlacesControllerDragHelper.canMoveNode(draggedElt, this._rootView, elt))
if (!PlacesControllerDragHelper.canMoveNode(draggedElt, this._rootView))
event.dataTransfer.effectAllowed = "copyLink";
// Activate the view and cache the dragged element.