From 274d384572f5699ddf0b43065235b32304954ca1 Mon Sep 17 00:00:00 2001 From: tusooa Date: Sat, 14 Jan 2023 10:19:08 -0500 Subject: Make modal easier to close if there is only one image --- src/components/media_modal/media_modal.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/components/media_modal/media_modal.js') diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index ff993664..05ef9fbe 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -63,6 +63,11 @@ const MediaModal = { }, type () { return this.currentMedia ? this.getType(this.currentMedia) : null + }, + swipeDisableClickThreshold () { + // If there is only one media, allow more mouse movements to close the modal + // because there is less chance that the user wants to switch to another image + return () => this.canNavigate ? 1 : 30 } }, methods: { -- cgit v1.2.3-70-g09d2