diff --git a/client/src/App.vue b/client/src/App.vue index 843d2bd1..9dcdbda5 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -23,13 +23,8 @@ import ScrollUp from '@/components/ScrollUp'; import ReadOnlyBanner from '@/components/ReadOnlyBanner'; - const Modal = () => import(/* webpackChunkName: "modals" */'@/components/Modal'); - const FullscreenImage = () => import(/* webpackChunkName: "modals" */'@/components/FullscreenImage'); - const FullscreenInfographic = () => import(/* webpackChunkName: "modals" */'@/components/FullscreenInfographic'); - const FullscreenVideo = () => import(/* webpackChunkName: "modals" */'@/components/FullscreenVideo'); - const DeactivatePerson = () => import(/* webpackChunkName: "modals" */'@/components/profile/DeactivatePerson'); - const SnapshotCreated = () => import(/* webpackChunkName: "modals" */'@/components/modules/SnapshotCreated'); - const ChangeVisibility = () => import(/* webpackChunkName: "modals" */'@/components/rooms/ChangeVisibility'); + import modals from '@/components/modals'; + const NewContentBlockWizard = () => import(/* webpackChunkName: "content-forms" */'@/components/content-block-form/NewContentBlockWizard'); const EditContentBlockWizard = () => import(/* webpackChunkName: "content-forms" */'@/components/content-block-form/EditContentBlockWizard'); const NewRoomEntryWizard = () => import(/* webpackChunkName: "content-forms" */'@/components/rooms/room-entries/NewRoomEntryWizard'); @@ -60,7 +55,6 @@ PublicLayout, BlankLayout, SplitLayout, - Modal, NewContentBlockWizard, EditContentBlockWizard, NewRoomEntryWizard, @@ -72,12 +66,7 @@ EditNoteWizard, EditClassNameWizard, EditTeamNameWizard, - FullscreenImage, - FullscreenInfographic, - FullscreenVideo, - DeactivatePerson, - SnapshotCreated, - ChangeVisibility, + ...modals }, computed: { diff --git a/client/src/components/modals/Confirm.vue b/client/src/components/modals/Confirm.vue new file mode 100644 index 00000000..faf6cd02 --- /dev/null +++ b/client/src/components/modals/Confirm.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/client/src/components/modals/index.js b/client/src/components/modals/index.js new file mode 100644 index 00000000..723d3e7f --- /dev/null +++ b/client/src/components/modals/index.js @@ -0,0 +1,19 @@ +const Modal = () => import(/* webpackChunkName: "modals" */'@/components/Modal'); +const FullscreenImage = () => import(/* webpackChunkName: "modals" */'@/components/FullscreenImage'); +const FullscreenInfographic = () => import(/* webpackChunkName: "modals" */'@/components/FullscreenInfographic'); +const FullscreenVideo = () => import(/* webpackChunkName: "modals" */'@/components/FullscreenVideo'); +const DeactivatePerson = () => import(/* webpackChunkName: "modals" */'@/components/profile/DeactivatePerson'); +const SnapshotCreated = () => import(/* webpackChunkName: "modals" */'@/components/modules/SnapshotCreated'); +const ChangeVisibility = () => import(/* webpackChunkName: "modals" */'@/components/rooms/ChangeVisibility'); +const Confirm = () => import(/* webpackChunkName: "modals" */'@/components/modals/Confirm'); + +export default { + Modal, + FullscreenImage, + FullscreenInfographic, + FullscreenVideo, + DeactivatePerson, + SnapshotCreated, + ChangeVisibility, + Confirm, +}; diff --git a/client/src/pages/createContentBlock.vue b/client/src/pages/createContentBlock.vue index 0b79aaef..4bf6cca6 100644 --- a/client/src/pages/createContentBlock.vue +++ b/client/src/pages/createContentBlock.vue @@ -190,6 +190,15 @@ } }, remove(outer, inner) { + this.$modal.open('confirm') + .then(() => { + this.executeRemoval(outer, inner); + }) + .catch(() => { + + }); + }, + executeRemoval(outer, inner) { if (inner === undefined) { // not a list item container, just remove the element from the outer array this.contentBlock.contents = removeAtIndex(this.contentBlock.contents, outer);