mirror of
https://github.com/tenrok/vue-ganttastic.git
synced 2026-06-24 05:40:33 +03:00
fix: resize event unbinding
This commit is contained in:
+4
-2
@@ -28,12 +28,14 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bili": "^4.10.0",
|
"bili": "^4.10.0",
|
||||||
"rollup-plugin-vue": "^5.1.9",
|
"rollup-plugin-vue": "^5.1.9",
|
||||||
"vue-template-compiler": "^2.6.10"
|
"vue-template-compiler": "^2.6.14"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"moment": "^2.26.0"
|
"moment": "^2.26.0"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {
|
||||||
|
"vue": "^2.6.14"
|
||||||
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/yicone/vue-ganttastic/issues"
|
"url": "https://github.com/yicone/vue-ganttastic/issues"
|
||||||
},
|
},
|
||||||
|
|||||||
+11
-7
@@ -95,13 +95,16 @@ export default {
|
|||||||
window.addEventListener('resize', this.onWindowResize)
|
window.addEventListener('resize', this.onWindowResize)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
destroyed() {
|
||||||
|
window.removeEventListener('resize', this.onWindowResize)
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onDragover(e) {
|
onDragover(e) {
|
||||||
e.preventDefault() // enables dropping content on row
|
e.preventDefault() // enables dropping content on row
|
||||||
if (this.highlightOnHover) {
|
if (this.highlightOnHover) {
|
||||||
this.$refs[
|
this.$refs['g-gantt-row'].style.backgroundColor =
|
||||||
'g-gantt-row'
|
this.getThemeColors().hoverHighlight
|
||||||
].style.backgroundColor = this.getThemeColors().hoverHighlight
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -153,9 +156,8 @@ export default {
|
|||||||
|
|
||||||
onMouseover() {
|
onMouseover() {
|
||||||
if (this.highlightOnHover) {
|
if (this.highlightOnHover) {
|
||||||
this.$refs[
|
this.$refs['g-gantt-row'].style.backgroundColor =
|
||||||
'g-gantt-row'
|
this.getThemeColors().hoverHighlight
|
||||||
].style.backgroundColor = this.getThemeColors().hoverHighlight
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -165,7 +167,9 @@ export default {
|
|||||||
|
|
||||||
onWindowResize() {
|
onWindowResize() {
|
||||||
// re-initialize the barContainer DOMRect variable, which will trigger re-rendering in the gantt bars
|
// re-initialize the barContainer DOMRect variable, which will trigger re-rendering in the gantt bars
|
||||||
this.barContainer = this.$refs.barContainer.getBoundingClientRect()
|
if (this.$refs.barContainer) {
|
||||||
|
this.barContainer = this.$refs.barContainer.getBoundingClientRect()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user