(FINALLY) fixed duplicate move request bug

This commit is contained in:
Joel Collins 2019-11-11 15:00:41 +00:00
parent 13d4c9a2fe
commit 051eabbdc3
3 changed files with 37 additions and 25 deletions

View file

@ -125,6 +125,12 @@ export default {
}
},
created: function () {
window.addEventListener('keydown', this.keyDownMonitor);
window.addEventListener("keyup", this.keyUpMonitor);
window.addEventListener('wheel', this.wheelMonitor);
},
mounted() {
// A global signal listener to perform a move action
this.$root.$on('globalMoveEvent', (x, y, z, absolute) => {
@ -132,6 +138,17 @@ export default {
})
},
beforeDestroy () {
// Remove global signal listener to perform a move action
this.$root.$off('globalMoveEvent')
},
destroyed: function () {
window.removeEventListener('keydown', this.keyDownMonitor);
window.removeEventListener("keyup", this.keyUpMonitor);
window.removeEventListener('wheel', this.wheelMonitor);
},
methods: {
// Handle global mouse wheel events to be associated with navigation
wheelMonitor: function(event) {
@ -271,12 +288,6 @@ export default {
},
created: function () {
window.addEventListener('keydown', this.keyDownMonitor);
window.addEventListener("keyup", this.keyUpMonitor);
window.addEventListener('wheel', this.wheelMonitor);
},
computed: {
positionApiUri: function () {
return this.$store.getters.uri + "/stage/position"