mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-25 09:00:33 +03:00
Some bar events also emit the time position in the gantt chart on which they occured (e.g. contextmenu-bar)
This commit is contained in:
Generated
+935
-935
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-ganttastic",
|
"name": "vue-ganttastic",
|
||||||
"version": "0.9.30",
|
"version": "0.9.31",
|
||||||
"description": "A simple and customizable Gantt chart component for Vue.js",
|
"description": "A simple and customizable Gantt chart component for Vue.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
+11
-7
@@ -153,25 +153,28 @@ export default {
|
|||||||
clearTimeout(this.tooltipTimeout)
|
clearTimeout(this.tooltipTimeout)
|
||||||
}
|
}
|
||||||
this.tooltipTimeout = setTimeout(() => this.showTooltip = true, 800)
|
this.tooltipTimeout = setTimeout(() => this.showTooltip = true, 800)
|
||||||
this.onBarEvent(e, this)
|
this.onBarEvent({event: e, type: e.type}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
onMouseleave(e){
|
onMouseleave(e){
|
||||||
clearTimeout(this.tooltipTimeout)
|
clearTimeout(this.tooltipTimeout)
|
||||||
this.showTooltip = false
|
this.showTooltip = false
|
||||||
this.onBarEvent(e, this)
|
this.onBarEvent({event: e, type: e.type}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
onContextmenu(e){
|
onContextmenu(e){
|
||||||
this.onBarEvent(e, this)
|
const time = this.mapPositionToTime(e.clientX - this.barContainer.left).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
this.onBarEvent({event: e, type: e.type, time}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
onClick(e){
|
onClick(e){
|
||||||
this.onBarEvent(e, this)
|
const time = this.mapPositionToTime(e.clientX - this.barContainer.left).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
this.onBarEvent({event: e, type: e.type, time}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
onDblclick(e) {
|
onDblclick(e) {
|
||||||
this.onBarEvent(e, this)
|
const time = this.mapPositionToTime(e.clientX - this.barContainer.left).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
this.onBarEvent({event: e, type: e.type, time}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
onMousedown(e){
|
onMousedown(e){
|
||||||
@@ -189,7 +192,8 @@ export default {
|
|||||||
{once: true}
|
{once: true}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
this.onBarEvent(e, this)
|
const time = this.mapPositionToTime(e.clientX - this.barContainer.left).format("YYYY-MM-DD HH:mm:ss")
|
||||||
|
this.onBarEvent({event: e, type: e.type, time}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
onFirstMousemove(e){
|
onFirstMousemove(e){
|
||||||
@@ -234,7 +238,7 @@ export default {
|
|||||||
this.barStartMoment = this.mapPositionToTime(newXStart)
|
this.barStartMoment = this.mapPositionToTime(newXStart)
|
||||||
this.barEndMoment = this.mapPositionToTime(newXEnd)
|
this.barEndMoment = this.mapPositionToTime(newXEnd)
|
||||||
this.manageOverlapping()
|
this.manageOverlapping()
|
||||||
this.onBarEvent({...e, type: "drag"}, this)
|
this.onBarEvent({event: e, type: "drag"}, this)
|
||||||
},
|
},
|
||||||
|
|
||||||
dragByHandleLeft(e){
|
dragByHandleLeft(e){
|
||||||
|
|||||||
+2
-2
@@ -149,8 +149,8 @@ export default {
|
|||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|
||||||
onBarEvent(e, ganttBar){
|
onBarEvent({event, type, time}, ganttBar){
|
||||||
this.$emit(`${e.type}-bar`, {event: e, bar: ganttBar.bar})
|
this.$emit(`${type}-bar`, {event, bar: ganttBar.bar, time})
|
||||||
},
|
},
|
||||||
|
|
||||||
onDragendBar(e, ganttBar){
|
onDragendBar(e, ganttBar){
|
||||||
|
|||||||
Reference in New Issue
Block a user