From 33abe49a8b682bd8b659e64ef8e611a772f8a4a0 Mon Sep 17 00:00:00 2001 From: Sergey Solodyagin Date: Thu, 18 Nov 2021 13:10:57 +0300 Subject: [PATCH] Update lib/components/GGanttRow.vue Co-authored-by: Diego Galeano --- lib/components/GGanttRow.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/components/GGanttRow.vue b/lib/components/GGanttRow.vue index 1d6fd33..ab088a9 100644 --- a/lib/components/GGanttRow.vue +++ b/lib/components/GGanttRow.vue @@ -159,11 +159,11 @@ export default { }, onDrop(e) { - let barContainer = this.$refs.barContainer.getBoundingClientRect() - let xPos = e.clientX - barContainer.left - let timeDiffFromStart = (xPos / barContainer.width) * this.timeCount - let time = moment(this.chartStart).add(timeDiffFromStart, this.timeUnit) - let bar = this.localBars.find(bar => + const barContainer = this.$refs.barContainer.getBoundingClientRect() + const xPos = e.clientX - barContainer.left + const timeDiffFromStart = (xPos / barContainer.width) * this.timeCount + const time = moment(this.chartStart).add(timeDiffFromStart, this.timeUnit) + const bar = this.localBars.find(bar => time.isBetween( bar[this.chartProps.barStartKey], bar[this.chartProps.barEndKey]