Fix double-clicking an item selecting its text

Cancel the selection on a double-click. This still allows selection by
click-and-drag, which can be useful.
This commit is contained in:
Oliver Hamlet
2016-03-05 11:49:26 +00:00
parent aa2eb2b432
commit b6541b6b35
+4
View File
@@ -354,6 +354,10 @@ function onSidebarClick(evt) {
document.getElementById('pluginCardList').scrollToIndex(index);
if (evt.type === 'dblclick') {
/* Double-clicking can select the item's text, clear the selection in
case that has happened. */
window.getSelection().removeAllRanges();
const card = document.getElementById(evt.target.getAttribute('data-id'));
if (!card.classList.contains('flip')) {
document.getElementById(evt.target.getAttribute('data-id')).onShowEditor();