Skip to content

Commit

Permalink
revise image zoom toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolarosa committed Jun 14, 2024
1 parent 8ea993b commit 26caacf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vue-components/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
const props = defineProps({
src: { type: String, required: true },
});
const enableZoom = window.innerWidth > "900" ? true : false;
let enableZoom = true;
// if we're on a touch device and window small - disable zoom
// this way we can pinch to zoom
if ("ontouchstart" in window && window.innerWidth <= 1200) {
enableZoom = false;
}
</script>

0 comments on commit 26caacf

Please sign in to comment.