From 572f463a0bb0299d7668bde0d7cb48af4aa74836 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 19 Jun 2020 18:10:39 +0530 Subject: [PATCH] fix: Separate popup trigger and click event --- src/bar.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/bar.js b/src/bar.js index ee4f21b..c9240df 100644 --- a/src/bar.js +++ b/src/bar.js @@ -181,14 +181,18 @@ export default class Bar { return; } - if (e.type === 'click') { - this.gantt.trigger_event('click', [this.task]); + this.show_popup(); + this.gantt.unselect_all(); + this.group.classList.add('active'); + }); + + $.on(this.group, 'dblclick', e => { + if (this.action_completed) { + // just finished a move action, wait for a few seconds + return; } - this.gantt.unselect_all(); - this.group.classList.toggle('active'); - - this.show_popup(); + this.gantt.trigger_event('click', [this.task]); }); }