Fix when dragging outside of the text of item pane message. Closes #2223

This commit is contained in:
Adomas Venčkauskas 2021-10-14 15:33:43 +03:00
parent 9432cb7e72
commit 7a9bd56b9d
2 changed files with 5 additions and 10 deletions

View file

@ -1982,12 +1982,12 @@ var ItemTree = class ItemTree extends LibraryTree {
Zotero.DragDrop.currentOrientation = getDragTargetOrient(event);
Zotero.debug(`Dragging over item ${row} with ${Zotero.DragDrop.currentOrientation}, drop row: ${this._dropRow}`);
var target = event.target;
var target = event.currentTarget;
if (target.classList.contains('items-tree-message')) {
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
if (target.firstChild.hasAttribute('allowdrop')) {
if (target.firstChild.dataset.allowdrop) {
target = doc.querySelector('#zotero-items-tree treechildren');
}
else {
@ -3049,7 +3049,7 @@ var ItemTree = class ItemTree extends LibraryTree {
}
}
div.setAttribute('allowdrop', true);
div.dataset.allowdrop = true;
}
// My Publications
else if (this.collectionTreeRow.isPublications()) {

View file

@ -153,16 +153,11 @@
flex-direction: column;
justify-content: center;
align-items: center;
width: calc(100% - 4em);
height: 100%;
position: absolute;
top: 0;
left: 2em;
right: 2em;
width: 100%;
}
.items-tree-message div {
padding: 0 35px;
padding: 0 65px;
}
.items-tree-message p {