Now beforeDestroy is actually called as a vue api event and added a lock for scrolling on ios when the component is mounted.

This commit is contained in:
2019-03-03 23:24:23 +01:00
parent 78f37b9e03
commit 4d3b74f6e1

View File

@@ -30,6 +30,17 @@ export default {
created() {
window.addEventListener('keyup', this.arrowNavigation)
},
mounted() {
document.ontouchmove = function (e) {
e.preventDefault();
}
},
beforeDestroy() {
window.removeEventListener('keyup')
document.ontouchmove = function (e) {
return true;
};
},
methods: {
hidePopover: () => store.dispatch('hidePopover'),
forwards: () => store.dispatch('incrementPopoverImage'),
@@ -44,9 +55,6 @@ export default {
this.hidePopover()
}
},
beforeDestroy() {
window.removeEventListener('keyup')
}
}
}
</script>