diff --git a/client/web/compose/src/components/PageBlocks/Wrap/base.vue b/client/web/compose/src/components/PageBlocks/Wrap/base.vue index ab0acddca..bdcd9de0a 100644 --- a/client/web/compose/src/components/PageBlocks/Wrap/base.vue +++ b/client/web/compose/src/components/PageBlocks/Wrap/base.vue @@ -41,7 +41,8 @@ export default { }, isBlockMagnified () { - return this.magnified + const { magnifiedBlockID } = this.$route.query + return this.magnified && magnifiedBlockID === this.block.blockID }, headerSet () { diff --git a/client/web/compose/src/components/Public/Page/Block/Modal.vue b/client/web/compose/src/components/Public/Page/Block/Modal.vue index dd5333c3f..1c746c5f7 100644 --- a/client/web/compose/src/components/Public/Page/Block/Modal.vue +++ b/client/web/compose/src/components/Public/Page/Block/Modal.vue @@ -9,8 +9,7 @@ hide-header hide-footer size="xl" - no-fade - @hidden="hideModal" + @hidden="onHidden" > { - this.$router.push({ query: { ...this.$route.query, magnifiedBlockID } }) - }, 300) - - return - } - - this.$nextTick(() => { - this.loadModal(magnifiedBlockID) - }) - }, - }, - }, - mounted () { this.$root.$on('magnify-page-block', this.magnifyPageBlock) + + const { magnifiedBlockID } = this.$route.query + + if (magnifiedBlockID) { + this.magnifyPageBlock({ blockID: magnifiedBlockID }) + } }, beforeDestroy () { @@ -117,7 +96,16 @@ export default { magnifyPageBlock ({ blockID, block } = {}) { this.customBlock = block const magnifiedBlockID = blockID || (block || {}).blockID - this.$router.push({ query: { ...this.$route.query, magnifiedBlockID } }) + this.loadModal(magnifiedBlockID) + + setTimeout(() => { + this.$router.push({ + query: { + ...this.$route.query, + magnifiedBlockID, + }, + }) + }, 300) }, loadModal (blockID) { @@ -150,9 +138,15 @@ export default { } }, - hideModal () { - this.showModal = false - this.$router.push({ query: { ...this.$route.query, magnifiedBlockID: undefined } }) + onHidden () { + setTimeout(() => { + this.$router.push({ + query: { + ...this.$route.query, + magnifiedBlockID: undefined, + }, + }) + }, 300) }, }, } diff --git a/client/web/compose/src/components/Public/Record/Modal.vue b/client/web/compose/src/components/Public/Record/Modal.vue index 9ff74a7f9..e8debaf1d 100644 --- a/client/web/compose/src/components/Public/Record/Modal.vue +++ b/client/web/compose/src/components/Public/Record/Modal.vue @@ -8,8 +8,7 @@ body-class="p-0 bg-gray" footer-class="p-0" size="xl" - no-fade - @hidden="hideModal" + @hidden="onHidden" >