From b8f69d628167b31f851da8b88e303d2c60d824d5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 20 Jul 2014 02:11:11 -0400 Subject: [PATCH] Fix Quick Copy drag to Chrome textareas on Windows Possibly to other places as well (but not Notepad, which doesn't work from Firefox or Chrome either) Unfortunately this requires going back to 'copy' cursor feedback when dragging, even when Shift is used. We can only choose one on Windows (as far as I can tell), and we were previously using the unadorned 'move'. --- chrome/content/zotero/xpcom/itemTreeView.js | 2 +- chrome/content/zotero/xpcom/libraryTreeView.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 23e1ac159d..7f7b3faf7d 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -2558,7 +2558,7 @@ Zotero.ItemTreeCommandController.prototype.onEvent = function(evt) Zotero.ItemTreeView.prototype.onDragStart = function (event) { // See note in LibraryTreeView::_setDropEffect() if (Zotero.isWin) { - event.dataTransfer.effectAllowed = 'move'; + event.dataTransfer.effectAllowed = 'copy'; } var itemIDs = this.saveSelection(); diff --git a/chrome/content/zotero/xpcom/libraryTreeView.js b/chrome/content/zotero/xpcom/libraryTreeView.js index a6cd76b354..90f25e0551 100644 --- a/chrome/content/zotero/xpcom/libraryTreeView.js +++ b/chrome/content/zotero/xpcom/libraryTreeView.js @@ -208,6 +208,11 @@ Zotero.LibraryTreeView.prototype = { // as the dropEffect. This allows the dropEffect setting (which we use // in the tree's canDrop() and drop() to determine the desired action) // to be changed, even if the cursor doesn't reflect the new setting. + // + // Update (07/2014): We now use 'copy' for effectAllowed on Windows in + // onDragStart, since with 'move' text can't be dragged to Chrome + // textareas (and probably other places). This locks the cursor at copy, + // even when Shift is used, but that seems less bad. if (Zotero.isWin) { event.dataTransfer.effectAllowed = effect; }