commit 7b4f16e23324b39961294dcce886019e512d456f
parent 2e2f7e3f84d633d6c24e3e2879e9a6e2abbfe0d5
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 29 Oct 2011 15:50:57 -0400
Show the + symbol when dragging items between collections or libraries
TODO: don't show symbol when the item can't be dropped
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -1189,6 +1189,7 @@ Zotero.CollectionTreeView.prototype.canDrop = function(row, orient, dragData)
if (!dragData || !dragData.data) {
var dragData = Zotero.DragDrop.getDragData(this);
}
+
if (!dragData) {
return false;
}
@@ -1770,6 +1771,10 @@ Zotero.CollectionTreeView.prototype.onDragEnter = function (event) {
* Called by HTML 5 Drag and Drop when dragging over the tree
*/
Zotero.CollectionTreeView.prototype.onDragOver = function (event, dropdata, session) {
+ // Show copy symbol when dragging an item over a collection
+ if (event.dataTransfer.getData("zotero/item")) {
+ event.dataTransfer.dropEffect = "copy";
+ }
return false;
}