mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-24 04:40:34 +03:00
fix: incorrect pos of adding bar
This commit is contained in:
+3
-2
@@ -126,8 +126,9 @@ export default {
|
|||||||
onDoubleClick(e) {
|
onDoubleClick(e) {
|
||||||
let barContainer = this.$refs.barContainer.getBoundingClientRect()
|
let barContainer = this.$refs.barContainer.getBoundingClientRect()
|
||||||
let xPos = e.clientX - barContainer.left
|
let xPos = e.clientX - barContainer.left
|
||||||
let timeDiffFromStart =
|
let timeDiffFromStart = Math.floor(
|
||||||
Math.round(xPos / barContainer.width * this.getTimeCount())
|
(xPos / barContainer.width) * this.getTimeCount()
|
||||||
|
)
|
||||||
let time = moment(this.getChartStart()).add(
|
let time = moment(this.getChartStart()).add(
|
||||||
timeDiffFromStart,
|
timeDiffFromStart,
|
||||||
this.timeUnit
|
this.timeUnit
|
||||||
|
|||||||
Reference in New Issue
Block a user