www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 6eb354bf3630e58fa25cdfd82488ed074bd6694b
parent 82769f0b9cb3cc0b43a696cb68a669383f1565cd
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  3 Sep 2013 04:49:02 -0400

Fix cursor feedback for file drag-in on Linux, where we can set it

Diffstat:
Mchrome/content/zotero/xpcom/collectionTreeView.js | 31++++++++++++-------------------
Mchrome/content/zotero/xpcom/itemTreeView.js | 30++++++++++++------------------
2 files changed, 24 insertions(+), 37 deletions(-)

diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -1782,14 +1782,21 @@ Zotero.CollectionTreeView.prototype.onDragOver = function (event) { // - Setting the dropEffect only works on Linux and OS X. // // - Modifier keys don't show up in the drag event on OS X until the - // drop, so since we can't show a correct effect, we leave it at - // the default 'move', the least misleading option. + // drop (https://bugzilla.mozilla.org/show_bug.cgi?id=911918), + // so since we can't show a correct effect, we leave it at + // the default 'move', the least misleading option, and set it + // below in onDrop(). // // - The cursor effect gets set by the system on Windows 7 and can't // be overridden. if (!Zotero.isMac) { - if (event.ctrlKey && event.shiftKey) { - event.dataTransfer.dropEffect = "link"; + if (event.shiftKey) { + if (event.ctrlKey) { + event.dataTransfer.dropEffect = "link"; + } + else { + event.dataTransfer.dropEffect = "move"; + } } else { event.dataTransfer.dropEffect = "copy"; @@ -1809,9 +1816,8 @@ Zotero.CollectionTreeView.prototype.onDragOver = function (event) { */ Zotero.CollectionTreeView.prototype.onDrop = function (event) { if (event.dataTransfer.types.contains("application/x-moz-file")) { - Zotero.DragDrop.currentDataTransfer = event.dataTransfer; - Zotero.safeDebug(event); if (Zotero.isMac) { + Zotero.DragDrop.currentDataTransfer = event.dataTransfer; if (event.metaKey) { if (event.altKey) { event.dataTransfer.dropEffect = 'link'; @@ -1824,19 +1830,6 @@ Zotero.CollectionTreeView.prototype.onDrop = function (event) { event.dataTransfer.dropEffect = 'copy'; } } - else { - if (event.shiftKey) { - if (event.ctrlKey) { - event.dataTransfer.dropEffect = "link"; - } - else { - event.dataTransfer.dropEffect = "move"; - } - } - else { - event.dataTransfer.dropEffect = "copy"; - } - } } return false; } diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js @@ -3062,14 +3062,21 @@ Zotero.ItemTreeView.prototype.onDragOver = function (event) { // - Setting the dropEffect only works on Linux and OS X. // // - Modifier keys don't show up in the drag event on OS X until the - // drop, so since we can't show a correct effect, we leave it at - // the default 'move', the least misleading option. + // drop (https://bugzilla.mozilla.org/show_bug.cgi?id=911918), + // so since we can't show a correct effect, we leave it at + // the default 'move', the least misleading option, and set it + // below in onDrop(). // // - The cursor effect gets set by the system on Windows 7 and can't // be overridden. if (!Zotero.isMac) { - if (event.ctrlKey && event.shiftKey) { - event.dataTransfer.dropEffect = "link"; + if (event.shiftKey) { + if (event.ctrlKey) { + event.dataTransfer.dropEffect = "link"; + } + else { + event.dataTransfer.dropEffect = "move"; + } } else { event.dataTransfer.dropEffect = "copy"; @@ -3089,8 +3096,8 @@ Zotero.ItemTreeView.prototype.onDragOver = function (event) { */ Zotero.ItemTreeView.prototype.onDrop = function (event) { if (event.dataTransfer.types.contains("application/x-moz-file")) { - Zotero.DragDrop.currentDataTransfer = event.dataTransfer; if (Zotero.isMac) { + Zotero.DragDrop.currentDataTransfer = event.dataTransfer; if (event.metaKey) { if (event.altKey) { event.dataTransfer.dropEffect = 'link'; @@ -3103,19 +3110,6 @@ Zotero.ItemTreeView.prototype.onDrop = function (event) { event.dataTransfer.dropEffect = 'copy'; } } - else { - if (event.shiftKey) { - if (event.ctrlKey) { - event.dataTransfer.dropEffect = "link"; - } - else { - event.dataTransfer.dropEffect = "move"; - } - } - else { - event.dataTransfer.dropEffect = "copy"; - } - } } return false; }