Frontend: Code clean-up

This commit is contained in:
Michael Mayer 2021-01-08 14:30:58 +01:00
parent 0ae5b7831d
commit b1934d2533
2 changed files with 20 additions and 20 deletions

View file

@ -22,13 +22,22 @@ import "./css/app.css";
import Event from "pubsub-js";
export default {
name: 'photoprism',
name: 'Photoprism',
data() {
return {
touchStart: 0,
};
},
computed: {},
created() {
window.addEventListener('touchstart', (e) => this.onTouchStart(e), {passive: true});
window.addEventListener('touchmove', (e) => this.onTouchMove(e), {passive: true});
this.$config.setVuetify(this.$vuetify);
},
destroyed() {
window.removeEventListener('touchstart', (e) => this.onTouchStart(e), false);
window.removeEventListener('touchmove', (e) => this.onTouchMove(e), false);
},
methods: {
onTouchStart(e) {
this.touchStart = e.touches[0].pageY;
@ -49,14 +58,5 @@ export default {
}
},
},
created() {
window.addEventListener('touchstart', (e) => this.onTouchStart(e), {passive: true});
window.addEventListener('touchmove', (e) => this.onTouchMove(e), {passive: true});
this.$config.setVuetify(this.$vuetify);
},
destroyed() {
window.removeEventListener('touchstart', (e) => this.onTouchStart(e), false);
window.removeEventListener('touchmove', (e) => this.onTouchMove(e), false);
},
};
</script>

View file

@ -22,13 +22,22 @@ import "./css/app.css";
import Event from "pubsub-js";
export default {
name: 'photoprism',
name: 'Photoprism',
data() {
return {
touchStart: 0,
};
},
computed: {},
created() {
window.addEventListener('touchstart', (e) => this.onTouchStart(e), {passive: true});
window.addEventListener('touchmove', (e) => this.onTouchMove(e), {passive: true});
this.$config.setVuetify(this.$vuetify);
},
destroyed() {
window.removeEventListener('touchstart', (e) => this.onTouchStart(e), false);
window.removeEventListener('touchmove', (e) => this.onTouchMove(e), false);
},
methods: {
onTouchStart(e) {
this.touchStart = e.touches[0].pageY;
@ -49,14 +58,5 @@ export default {
}
},
},
created() {
window.addEventListener('touchstart', (e) => this.onTouchStart(e), {passive: true});
window.addEventListener('touchmove', (e) => this.onTouchMove(e), {passive: true});
this.$config.setVuetify(this.$vuetify);
},
destroyed() {
window.removeEventListener('touchstart', (e) => this.onTouchStart(e), false);
window.removeEventListener('touchmove', (e) => this.onTouchMove(e), false);
},
};
</script>