Skip to content

Commit

Permalink
adjust ios mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Jan 11, 2025
1 parent 5ff4f98 commit 5a96f4f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/javascript/elements/download_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/submission_form/completed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/submission_form/form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down Expand Up @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/template_builder/builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/template_builder/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down

0 comments on commit 5a96f4f

Please sign in to comment.