2
0
mirror of https://github.com/tenrok/vue-ganttastic.git synced 2026-06-18 19:00:34 +03:00

Highlighting on hover works while dragging a HTML element over a gantt row

This commit is contained in:
Marko Zunic
2021-01-13 11:50:02 +01:00
parent c2ed571162
commit e259224b2c
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vue-ganttastic",
"version": "0.9.30",
"version": "0.9.31",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "vue-ganttastic",
"version": "0.9.31",
"version": "0.9.32",
"description": "A simple and customizable Gantt chart component for Vue.js",
"repository": {
"type": "git",
+9
View File
@@ -18,6 +18,7 @@
ref="barContainer"
:style="barsContainerStyle"
@dragover="onDragover($event)"
@dragleave="onDragleave($event)"
@drop="onDrop($event)"
@mouseover="onMouseover()"
@mouseleave="onMouseleave()"
@@ -105,8 +106,16 @@ export default {
onDragover(e) {
e.preventDefault() // enables dropping content on row
if(this.highlightOnHover){
this.$refs["g-gantt-row"].style.backgroundColor = this.getThemeColors().hoverHighlight
}
},
onDragleave() {
this.$refs["g-gantt-row"].style.backgroundColor = null
},
onDrop(e){
let barContainer = this.$refs.barContainer.getBoundingClientRect()
let xPos = e.clientX - barContainer.left