From b1934d253343624c2b57f88363c41147df65a92e Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Fri, 8 Jan 2021 14:30:58 +0100 Subject: [PATCH] Frontend: Code clean-up --- frontend/src/app.vue | 20 ++++++++++---------- frontend/src/share.vue | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/frontend/src/app.vue b/frontend/src/app.vue index 51b40ba5f..c1c4ac8cb 100644 --- a/frontend/src/app.vue +++ b/frontend/src/app.vue @@ -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); - }, }; diff --git a/frontend/src/share.vue b/frontend/src/share.vue index 51b40ba5f..c1c4ac8cb 100644 --- a/frontend/src/share.vue +++ b/frontend/src/share.vue @@ -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); - }, };