mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-23 19:10:33 +03:00
Update lib/components/GGanttRow.vue
Co-authored-by: Diego Galeano <diegood@users.noreply.github.com>
This commit is contained in:
@@ -159,11 +159,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onDrop(e) {
|
onDrop(e) {
|
||||||
let barContainer = this.$refs.barContainer.getBoundingClientRect()
|
const barContainer = this.$refs.barContainer.getBoundingClientRect()
|
||||||
let xPos = e.clientX - barContainer.left
|
const xPos = e.clientX - barContainer.left
|
||||||
let timeDiffFromStart = (xPos / barContainer.width) * this.timeCount
|
const timeDiffFromStart = (xPos / barContainer.width) * this.timeCount
|
||||||
let time = moment(this.chartStart).add(timeDiffFromStart, this.timeUnit)
|
const time = moment(this.chartStart).add(timeDiffFromStart, this.timeUnit)
|
||||||
let bar = this.localBars.find(bar =>
|
const bar = this.localBars.find(bar =>
|
||||||
time.isBetween(
|
time.isBetween(
|
||||||
bar[this.chartProps.barStartKey],
|
bar[this.chartProps.barStartKey],
|
||||||
bar[this.chartProps.barEndKey]
|
bar[this.chartProps.barEndKey]
|
||||||
|
|||||||
Reference in New Issue
Block a user