diff --git a/browser/components/places/content/menu.xml b/browser/components/places/content/menu.xml index af0ed8352f3..c8e157c3edd 100755 --- a/browser/components/places/content/menu.xml +++ b/browser/components/places/content/menu.xml @@ -610,7 +610,7 @@ this._self._selection = event.target.node; if (event.ctrlKey) dragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY; - xferData.data = this._controller.getTransferData(dragAction.action); + xferData.data = this._self._controller.getTransferData(dragAction.action); }, canDrop: function TBV_DO_canDrop(event, session) { diff --git a/browser/components/places/content/tree.xml b/browser/components/places/content/tree.xml index 0e275af344e..b3e7ee710ce 100644 --- a/browser/components/places/content/tree.xml +++ b/browser/components/places/content/tree.xml @@ -57,10 +57,14 @@ setTimeout(function() { self.place = self.place; }, 0); ]]> - result->treeviewer cycle. + // Note: unsetting the result's viewer also unsets + // the viewer's reference to our treeBoxObject. + var result = this.getResult(); + if (result) + result.viewer = null; this.view = null; - this._result = null; ]]> - + - + @@ -639,21 +643,21 @@ // Drag and Drop does not work while a tree view is sorted. if (this.getAttribute("sortActive") == "true") throw Cr.NS_OK; - - // Items that are "static" - i.e. above the user-configurable area - // of the view - can not be moved. + var nodes = this.getSelectionNodes(); for (var i = 0; i < nodes.length; ++i) { var node = nodes[i]; - + // If this node is part of a readonly container (e.g. a livemark) it // cannot be moved, only copied, so we must change the action used // by the drag session. var parent = node.parent; - if (PlacesUtils.nodeIsReadOnly(parent)) + if (PlacesUtils.nodeIsReadOnly(parent)) { dragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY; + break; + } } - + // XXXben - the drag wrapper should do this automatically. if (event.ctrlKey) dragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY; @@ -728,7 +732,7 @@ for (var i = 0; i < cc; ++i) { var node = aContainer.getChild(i); if (PlacesUtils.nodeIsFolder(node)) { - if (folder.itemId == aItemId) { + if (node.itemId == aItemId) { foundNode = node; break; } @@ -795,9 +799,6 @@ var result = this._self.getResult(); var resultview = this._self.getResultView(); var node = index != -1 ? resultview.nodeForTreeIndex(index) : result.root; - // Cannot drop before fixed items in the list. - if (node.parent == result.root && orientation != NHRVO.DROP_ON) - return false; if (orientation == NHRVO.DROP_ON) { // The user cannot drop an item into itself or a read-only container @@ -809,10 +810,10 @@ } else if (node.parent && PlacesUtils.nodeIsReadOnly(node.parent)) return false; - + return PlacesControllerDragHelper.canDrop(this._self, orientation); }, - + /** * Adjusts an InsertionPoint's insertion index using these rules: * XXXben define rules