From 93812c3d0b5fdd40d86e79eed666e4fd7ca1e8da Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Mon, 28 Apr 2008 09:33:41 +0000 Subject: [PATCH] Bug 428403: Creating a new folder via the bookmark contextual dialog always places it under bookmarks menu, patch by Marco Bonardo , r=mano, ui-r=beltzner, a=mconnor --- browser/components/places/content/menu.xml | 18 ++++++++++------- browser/components/places/content/toolbar.xml | 18 ++++++++++------- browser/components/places/content/tree.xml | 20 +++++++++---------- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/browser/components/places/content/menu.xml b/browser/components/places/content/menu.xml index ead46e5363f..92e47851f3c 100755 --- a/browser/components/places/content/menu.xml +++ b/browser/components/places/content/menu.xml @@ -181,6 +181,8 @@ this._overFolder.closeMenuTimer = this._overFolder .setTimer(this._overFolder.hoverTime); } + + this._rootView._draggedNode = null; ]]> @@ -896,8 +898,9 @@ diff --git a/browser/components/places/content/toolbar.xml b/browser/components/places/content/toolbar.xml index 4867a39e75b..b2c4d73018c 100755 --- a/browser/components/places/content/toolbar.xml +++ b/browser/components/places/content/toolbar.xml @@ -384,26 +384,28 @@ @@ -916,6 +918,8 @@ if (this._overFolder.node) this._overFolder.closeTimer = this._setTimer(this._overFolder.hoverTime); PlacesControllerDragHelper.currentDropTarget = null; + + this._self._draggedNode = null; }, getSupportedFlavours: function TBV_DO_getSupportedFlavours() { diff --git a/browser/components/places/content/tree.xml b/browser/components/places/content/tree.xml index 945988836cd..279958f795b 100644 --- a/browser/components/places/content/tree.xml +++ b/browser/components/places/content/tree.xml @@ -440,7 +440,7 @@ return this._cachedInsertionPoint = null; } - var orientation = Ci.nsITreeView.DROP_AFTER; + var orientation = Ci.nsITreeView.DROP_BEFORE; // If there is no selection, insert at the end of the container. if (!this.hasSelection) { var index = this.view.rowCount - 1; @@ -451,9 +451,9 @@ // This is a two-part process. The first part is determining the drop // orientation. - // * The default orientation is to drop _after_ the selected item. - // * If the selected item is an open container, the default - // orientation is to drop _into_ that container. + // * The default orientation is to drop _before_ the selected item. + // * If the selected item is a container, the default orientation + // is to drop _into_ that container. // // Warning: It may be tempting to use tree indexes in this code, but // you must not, since the tree is nested and as your tree @@ -468,18 +468,18 @@ var min = { }, max = { }; selection.getRangeAt(rc - 1, min, max); - // If the sole selection is an open container, insert into it rather - // than adjacent to it. Note that this only applies to _single_ - // selections - if the last element within a multi-selection is an - // open folder, insert _adjacent_ to the selection. + // If the sole selection is a container, and we are not in + // a flatlist, insert into it. + // Note that this only applies to _single_ selections, + // if the last element within a multi-selection is a + // container, insert _adjacent_ to the selection. // // If the sole selection is the bookmarks toolbar folder, we insert // into it even if it is not opened var itemId = PlacesUtils.getConcreteItemId(resultView.nodeForTreeIndex(max.value)); if (selection.count == 1 && resultView.isContainer(max.value) && - (resultView.isContainerOpen(max.value) || - itemId == PlacesUtils.bookmarksMenuFolderId)) + !this.flatList) orientation = Ci.nsITreeView.DROP_ON; this._cachedInsertionPoint =