From 348d6664eb07d4854ad4266873ad423091658187 Mon Sep 17 00:00:00 2001 From: taehoon Date: Fri, 18 Oct 2019 07:05:01 -0400 Subject: [PATCH] refactor all kind of modals using the modal component --- src/components/media_modal/media_modal.js | 4 +++- src/components/media_modal/media_modal.vue | 13 ++++--------- .../post_status_modal/post_status_modal.js | 4 +++- .../post_status_modal/post_status_modal.vue | 18 +++++------------- .../user_reporting_modal.js | 5 ++++- .../user_reporting_modal.vue | 19 ++++--------------- 6 files changed, 23 insertions(+), 40 deletions(-) diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index 992d7129d7..4832abda31 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 06ced5a1ac..69e75e2b85 100644 --- a/src/components/media_modal/media_modal.vue +++ b/src/components/media_modal/media_modal.vue @@ -1,9 +1,8 @@ @@ -44,10 +43,6 @@ .media-modal-view { z-index: 1001; - body:not(.scroll-locked) & { - display: none; - } - &:hover { .modal-view-button-arrow { opacity: 0.75; diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index 38258296e7..b44354db19 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -1,9 +1,11 @@ import PostStatusForm from '../post_status_form/post_status_form.vue' +import Modal from '../modal/modal.vue' import get from 'lodash/get' const PostStatusModal = { components: { - PostStatusForm + PostStatusForm, + Modal }, data () { return { diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue index b5e75de7c4..06ef0a3577 100644 --- a/src/components/post_status_modal/post_status_modal.vue +++ b/src/components/post_status_modal/post_status_modal.vue @@ -1,15 +1,11 @@ @@ -29,10 +25,6 @@ .post-form-modal-view { align-items: flex-start; - - body:not(.scroll-locked) & { - display: none; - } } .post-form-modal-panel { diff --git a/src/components/user_reporting_modal/user_reporting_modal.js b/src/components/user_reporting_modal/user_reporting_modal.js index 7c6ea40964..3fb9638479 100644 --- a/src/components/user_reporting_modal/user_reporting_modal.js +++ b/src/components/user_reporting_modal/user_reporting_modal.js @@ -2,12 +2,14 @@ import Status from '../status/status.vue' import List from '../list/list.vue' import Checkbox from '../checkbox/checkbox.vue' +import Modal from '../modal/modal.vue' const UserReportingModal = { components: { Status, List, - Checkbox + Checkbox, + Modal }, data () { return { @@ -51,6 +53,7 @@ const UserReportingModal = { this.error = false }, closeModal () { + console.log('closeModal clicked') this.$store.dispatch('closeUserReportingModal') }, reportUser () { diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue index ecbc1369f7..0dce4c55c1 100644 --- a/src/components/user_reporting_modal/user_reporting_modal.vue +++ b/src/components/user_reporting_modal/user_reporting_modal.vue @@ -1,14 +1,9 @@ @@ -78,12 +73,6 @@