Fix more ways that citation dialog textcursor can end up inside bubbles

See 5a1e3296, 5fa97957
This commit is contained in:
Adomas Venčkauskas 2020-01-16 10:58:28 +02:00
parent c6961b26e4
commit 09dead3a2a

View file

@ -1100,6 +1100,8 @@ var Zotero_QuickFormat = new function () {
return node;
}
}
} else if (container.parentNode.dataset && container.parentNode.dataset.citationItem) {
return container.parentNode;
}
}
return null;
@ -1195,7 +1197,22 @@ var Zotero_QuickFormat = new function () {
selection.removeAllRanges();
selection.addRange(nodeRange);
}
} else if (["Home", "End"].includes(event.key)) {
setTimeout(() => {
right = event.key == "End";
bubble = _getSelectedBubble(right);
if (bubble) {
event.preventDefault();
var nodeRange = qfiDocument.createRange();
nodeRange.selectNode(bubble);
nodeRange.collapse(!right);
var selection = qfiWindow.getSelection();
selection.removeAllRanges();
selection.addRange(nodeRange);
}
})
} else if(keyCode === event.DOM_VK_UP && referencePanel.state === "open") {
var selectedItem = referenceBox.selectedItem;