diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-10-22 05:53:23 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-10-22 05:53:23 +0000 |
| commit | cd956185207aca84666d38f516b6c4b666ee846b (patch) | |
| tree | c99e52945d37725975b9b48dd0c07052078a9a8b /src/components/media_modal | |
| parent | 051e6ea5ca8be5231d66e577a7e5407b53e08f61 (diff) | |
| parent | eb695fd61d97a8b4ce9de9c65b0133515d087a2c (diff) | |
Merge branch 'modal-scroll-lock' into 'develop'
Lock body scroll when modal is open globally
See merge request pleroma/pleroma-fe!974
Diffstat (limited to 'src/components/media_modal')
| -rw-r--r-- | src/components/media_modal/media_modal.js | 4 | ||||
| -rw-r--r-- | src/components/media_modal/media_modal.vue | 18 |
2 files changed, 8 insertions, 14 deletions
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index 992d7129..4832abda 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -1,11 +1,13 @@ import StillImage from '../still-image/still-image.vue' import VideoAttachment from '../video_attachment/video_attachment.vue' +import Modal from '../modal/modal.vue' import fileTypeService from '../../services/file_type/file_type.service.js' const MediaModal = { components: { StillImage, - VideoAttachment + VideoAttachment, + Modal }, computed: { showing () { diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue index 06ced5a1..2597f4e3 100644 --- a/src/components/media_modal/media_modal.vue +++ b/src/components/media_modal/media_modal.vue @@ -1,9 +1,8 @@ <template> - <div + <Modal v-if="showing" - v-body-scroll-lock="showing" - class="modal-view media-modal-view" - @click.prevent="hide" + class="media-modal-view" + @backdropClicked="hide" > <img v-if="type === 'image'" @@ -33,21 +32,15 @@ > <i class="icon-right-open arrow-icon" /> </button> - </div> + </Modal> </template> <script src="./media_modal.js"></script> <style lang="scss"> -@import '../../_variables.scss'; - -.media-modal-view { +.modal-view.media-modal-view { z-index: 1001; - body:not(.scroll-locked) & { - display: none; - } - &:hover { .modal-view-button-arrow { opacity: 0.75; @@ -114,5 +107,4 @@ } } } - </style> |
