From 5a96f4f1eb6e8b8b99767e3d540ffdc4584babc1 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Sat, 11 Jan 2025 14:02:04 +0200 Subject: [PATCH] adjust ios mobile --- app/javascript/elements/download_button.js | 2 +- app/javascript/submission_form/completed.vue | 2 +- app/javascript/submission_form/form.vue | 4 ++-- app/javascript/template_builder/builder.vue | 2 +- app/javascript/template_builder/page.vue | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/javascript/elements/download_button.js b/app/javascript/elements/download_button.js index 09e669022..160fc770a 100644 --- a/app/javascript/elements/download_button.js +++ b/app/javascript/elements/download_button.js @@ -20,7 +20,7 @@ export default targetable(class extends HTMLElement { fetch(this.dataset.src).then(async (response) => { if (response.ok) { const urls = await response.json() - const isMobileSafariIos = ('ontouchstart' in window || navigator.maxTouchPoints > 0) && /AppleWebKit/i.test(navigator.userAgent) + const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent) const isSafariIos = isMobileSafariIos || /iPhone|iPad|iPod/i.test(navigator.userAgent) if (isSafariIos && urls.length > 1) { diff --git a/app/javascript/submission_form/completed.vue b/app/javascript/submission_form/completed.vue index 98358e90c..c5ecfd27b 100644 --- a/app/javascript/submission_form/completed.vue +++ b/app/javascript/submission_form/completed.vue @@ -215,7 +215,7 @@ export default { fetch(this.baseUrl + `/submitters/${this.submitterSlug}/download`).then(async (response) => { if (response.ok) { const urls = await response.json() - const isMobileSafariIos = ('ontouchstart' in window || navigator.maxTouchPoints > 0) && /AppleWebKit/i.test(navigator.userAgent) + const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent) const isSafariIos = isMobileSafariIos || /iPhone|iPad|iPod/i.test(navigator.userAgent) if (isSafariIos && urls.length > 1) { diff --git a/app/javascript/submission_form/form.vue b/app/javascript/submission_form/form.vue index e52930718..c1d0d8a1c 100644 --- a/app/javascript/submission_form/form.vue +++ b/app/javascript/submission_form/form.vue @@ -856,7 +856,7 @@ export default { }, computed: { isMobile () { - const isMobileSafariIos = ('ontouchstart' in window || navigator.maxTouchPoints > 0) && /AppleWebKit/i.test(navigator.userAgent) + const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent) return isMobileSafariIos || /android|iphone|ipad/i.test(navigator.userAgent) }, @@ -1113,7 +1113,7 @@ export default { this.minimizeForm() } - const isMobileSafariIos = ('ontouchstart' in window || navigator.maxTouchPoints > 0) && /AppleWebKit/i.test(navigator.userAgent) + const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent) if (isMobileSafariIos || /iPhone|iPad|iPod/i.test(navigator.userAgent)) { this.$nextTick(() => { diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue index 408eef21e..1e22e3b9b 100644 --- a/app/javascript/template_builder/builder.vue +++ b/app/javascript/template_builder/builder.vue @@ -703,7 +703,7 @@ export default { return this.locale.split('-')[0].toLowerCase() }, isMobile () { - const isMobileSafariIos = ('ontouchstart' in window || navigator.maxTouchPoints > 0) && /AppleWebKit/i.test(navigator.userAgent) + const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent) return isMobileSafariIos || /android|iphone|ipad/i.test(navigator.userAgent) }, diff --git a/app/javascript/template_builder/page.vue b/app/javascript/template_builder/page.vue index 11f0c41f9..4161fd0b8 100644 --- a/app/javascript/template_builder/page.vue +++ b/app/javascript/template_builder/page.vue @@ -162,7 +162,7 @@ export default { } }, isMobile () { - const isMobileSafariIos = ('ontouchstart' in window || navigator.maxTouchPoints > 0) && /AppleWebKit/i.test(navigator.userAgent) + const isMobileSafariIos = 'ontouchstart' in window && navigator.maxTouchPoints > 0 && /AppleWebKit/i.test(navigator.userAgent) return isMobileSafariIos || /android|iphone|ipad/i.test(navigator.userAgent) },