From 307386554fd130bf6c24ce41b6f8f4a6c0d35608 Mon Sep 17 00:00:00 2001 From: maxpozdeev Date: Mon, 11 Jul 2022 00:09:01 +0300 Subject: [PATCH] * only doubleclick on task title will open task editor, not on notes --- src/content/mytinytodo.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/content/mytinytodo.js b/src/content/mytinytodo.js index 025bdcc..3008d8f 100644 --- a/src/content/mytinytodo.js +++ b/src/content/mytinytodo.js @@ -434,14 +434,14 @@ var mytinytodo = window.mytinytodo = _mtt = { } }); - $('#tasklist').on('dblclick', '> li.task-row', function(){ - //clear selection - if(document.selection && document.selection.empty && document.selection.createRange().text) document.selection.empty(); - else if(window.getSelection) window.getSelection().removeAllRanges(); + $('#tasklist').on('dblclick', '> li.task-row .task-middle', function(){ + var id = parseInt(getLiTaskId(this)); + if (id) { + //clear selection + if (document.selection && document.selection.empty && document.selection.createRange().text) document.selection.empty(); + else if(window.getSelection) window.getSelection().removeAllRanges(); - if (this.id) { - var id = this.id.split('_',2)[1]; - if (id) editTask(parseInt(id)); + editTask(parseInt(id)); } });