From 59edca783e2b2cff520b2af9e986315ab8b21ea3 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 9 Jul 2017 05:49:02 -0400 Subject: [PATCH] Allow dragging onto welcome text --- chrome/content/zotero/xpcom/itemTreeView.js | 2 ++ chrome/content/zotero/xpcom/libraryTreeView.js | 12 +++++++++++- chrome/content/zotero/zoteroPane.xul | 5 ++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/itemTreeView.js b/chrome/content/zotero/xpcom/itemTreeView.js index 8394165a41..cdeea68467 100644 --- a/chrome/content/zotero/xpcom/itemTreeView.js +++ b/chrome/content/zotero/xpcom/itemTreeView.js @@ -1765,6 +1765,8 @@ Zotero.ItemTreeView.prototype._updateIntroText = function() { }; } } + + div.setAttribute('allowdrop', true); } // My Publications else if (this.collectionTreeRow.isPublications()) { diff --git a/chrome/content/zotero/xpcom/libraryTreeView.js b/chrome/content/zotero/xpcom/libraryTreeView.js index f68eb65f94..31d757e5f3 100644 --- a/chrome/content/zotero/xpcom/libraryTreeView.js +++ b/chrome/content/zotero/xpcom/libraryTreeView.js @@ -328,7 +328,17 @@ Zotero.LibraryTreeView.prototype = { var target = event.target; if (target.tagName != 'treechildren') { - return false; + let doc = target.ownerDocument; + // Consider a drop on the items pane message box (e.g., when showing the welcome text) + // a drop on the items tree + let msgBox = doc.getElementById('zotero-items-pane-message-box'); + if (msgBox.contains(target) && msgBox.firstChild.hasAttribute('allowdrop')) { + target = doc.querySelector('#zotero-items-tree treechildren'); + } + else { + this._setDropEffect(event, "none"); + return false; + } } var tree = target.parentNode; let row = {}, col = {}, obj = {}; diff --git a/chrome/content/zotero/zoteroPane.xul b/chrome/content/zotero/zoteroPane.xul index de2c4c9ab4..1d17641e69 100644 --- a/chrome/content/zotero/zoteroPane.xul +++ b/chrome/content/zotero/zoteroPane.xul @@ -565,7 +565,10 @@ - +