commit 1336842d74ff4e0b5c45bc9a52b8a8f5bb1f6cd8
parent 4545a5d8a8d86c4d1e29c0e916619a4c625d6aed
Author: David Norton <david@nortoncrew.com>
Date: Thu, 8 Jun 2006 19:34:58 +0000
[interface] You should now be able to drop collections below the library (into root).
[interface] New items are automatically selected.
Diffstat:
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/collectionTreeView.js b/chrome/chromeFiles/content/scholar/collectionTreeView.js
@@ -248,11 +248,8 @@ Scholar.CollectionTreeView.prototype._refreshHashMap = function()
Scholar.CollectionTreeView.prototype.canDrop = function(row, orient)
{
- if(orient == 0 && this._getItemAtRow(row).isCollection())
- {
- Scholar.debug("drag on row: " + row + " orient: " + orient);
+ if((row == 0 && orient == 1) || orient == 0)
return true;
- }
else
return false;
}
@@ -269,7 +266,7 @@ Scholar.CollectionTreeView.prototype.drop = function(row, orient)
var oldCount = this.rowCount;
var targetCollectionID;
- if(this.canDrop(row,orient))
+ if(this._getItemAtRow(row).isCollection())
targetCollectionID = this._getItemAtRow(row).ref.getID();
var droppedCollection = Scholar.Collections.get(ids[0]);
@@ -300,7 +297,6 @@ Scholar.CollectionTreeView.prototype.getSupportedFlavours = function ()
return flavors;
}
-Scholar.CollectionTreeView.prototype.onDragOver = function (evt,dropdata,session) { }
Scholar.CollectionTreeView.prototype.onDrop = function (evt,dropdata,session) { }
//
diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js
@@ -253,9 +253,6 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids)
if(madeChanges)
{
- if(action == 'add')
- this.selection.select(this._itemRowMap[item.getID()]);
-
if(this.isSorted())
{
this.sort(); //this also refreshes the hash map
@@ -266,7 +263,10 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, ids)
this._refreshHashMap();
}
- this.rememberSelection();
+ if(action == 'add')
+ this.selection.select(this._itemRowMap[item.getID()]);
+ else
+ this.rememberSelection();
}
this.selection.selectEventsSuppressed = false;
}
diff --git a/chrome/chromeFiles/content/scholar/overlay.xul b/chrome/chromeFiles/content/scholar/overlay.xul
@@ -28,7 +28,7 @@
</toolbar>
<tree id="collections-tree" hidecolumnpicker="true"
onselect="ScholarPane.onCollectionSelected();" seltype="single"
- ondragover="nsDragAndDrop.dragOver(event,ScholarPane.getCollectionsView())" ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getCollectionsView())"
+ ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getCollectionsView())"
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getCollectionsView());"
onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteCollectionSelection(); return false; }"
flex="1">
@@ -59,7 +59,7 @@
enableColumnDrag="true" onkeypress="if(event.keyCode == event.DOM_VK_BACK_SPACE || event.keyCode == event.DOM_VK_DELETE){ ScholarPane.deleteItemSelection(); return false; }"
onselect="ScholarPane.itemSelected();"
ondraggesture="if (event.target.localName == 'treechildren') nsDragAndDrop.startDrag(event,ScholarPane.getItemsView());"
- ondragover="nsDragAndDrop.dragOver(event,ScholarPane.getItemsView())" ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getItemsView())"
+ ondragdrop="nsDragAndDrop.drop(event,ScholarPane.getItemsView())"
flex="1">
<treecols>
<treecol