Explorar o código

Prevent the click event from firing on content below modal

Tusooa Zhu %!s(int64=3) %!d(string=hai) anos
pai
achega
3502d374e3
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/components/media_modal/media_modal.js

+ 6 - 1
src/components/media_modal/media_modal.js

@@ -70,7 +70,12 @@ const MediaModal = {
       return fileTypeService.fileType(media.mimetype)
     },
     hide () {
-      this.$store.dispatch('closeMediaViewer')
+      // HACK: Closing immediately via a touch will cause the click
+      // to be processed on the content below the overlay
+      const transitionTime = 100 // ms
+      setTimeout(() => {
+        this.$store.dispatch('closeMediaViewer')
+      }, transitionTime)
     },
     goPrev () {
       if (this.canNavigate) {