From b78ed02bf4d54ce99b59fe07897ca71d9a5e7600 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 12 Sep 2023 14:11:34 +0200 Subject: [PATCH] Fix z-index issues with share modal [SCI-9279] --- .../components/shareable_link_modal.vue | 9 ++++++-- .../vue/shareable_links/container.vue | 22 +++++++++++-------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/app/javascript/vue/shareable_links/components/shareable_link_modal.vue b/app/javascript/vue/shareable_links/components/shareable_link_modal.vue index fa5fcdb12..ebe13bcb1 100644 --- a/app/javascript/vue/shareable_links/components/shareable_link_modal.vue +++ b/app/javascript/vue/shareable_links/components/shareable_link_modal.vue @@ -95,6 +95,10 @@ name: "shareModalContainer", components: { deleteShareableLinkModal }, props: { + open: { + type: Boolean, + required: true + }, shared: { type: Boolean, default: false @@ -123,11 +127,12 @@ watch: { shared() { this.sharedEnabled = this.shared; + }, + open() { + this.open ? this.showModal() : this.hideModal(); } }, mounted() { - - $(this.$refs.modal).modal('show'); $(this.$refs.modal).on('hidden.bs.modal', () => { if (!this.confirmingDelete) { this.$emit('close'); diff --git a/app/javascript/vue/shareable_links/container.vue b/app/javascript/vue/shareable_links/container.vue index d9fc2a360..9d2a5506e 100644 --- a/app/javascript/vue/shareable_links/container.vue +++ b/app/javascript/vue/shareable_links/container.vue @@ -12,14 +12,15 @@ {{ shareValue }} - - +
+ +
@@ -59,6 +60,10 @@ return this.i18n.t(this.share ? 'my_modules.shareable_links.shared' : 'my_modules.shareable_links.share'); } }, + mounted() { + // move modal to body to avoid z-index issues + $('body').append($(this.$refs.modal)); + }, methods:{ enableShare() { this.share = true; @@ -72,7 +77,6 @@ closeModal() { this.visibleShareModal = false; } - } };