Skip to content

Commit

Permalink
Change block magnify query param
Browse files Browse the repository at this point in the history
  • Loading branch information
kelanik8 authored and Fajfa committed Jun 7, 2023
1 parent d2b389b commit 5fde4c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/web/compose/src/components/PageBlocks/Wrap/base.vue
Expand Up @@ -34,7 +34,7 @@ export default {
},
isBlockOpened () {
return this.block.blockID === this.$route.query.blockID
return this.block.blockID === this.$route.query.magnifiedBlockID
},
headerSet () {
Expand Down
18 changes: 9 additions & 9 deletions client/web/compose/src/components/Public/Page/Block/Modal.vue
Expand Up @@ -76,26 +76,26 @@ export default {
},
watch: {
'$route.query.blockID': {
'$route.query.magnifiedBlockID': {
immediate: true,
handler (blockID, oldBlockID) {
if (!blockID) {
handler (magnifiedBlockID, oldMagnifiedBlockID) {
if (!magnifiedBlockID) {
this.showModal = false
return
}
if (this.showModal && (blockID !== oldBlockID)) {
if (this.showModal && (magnifiedBlockID !== oldMagnifiedBlockID)) {
this.showModal = false
setTimeout(() => {
this.$router.push({ query: { ...this.$route.query, blockID } })
this.$router.push({ query: { ...this.$route.query, magnifiedBlockID } })
}, 300)
return
}
setTimeout(() => {
this.loadModal(blockID)
this.loadModal(magnifiedBlockID)
}, 100)
},
},
Expand All @@ -112,8 +112,8 @@ export default {
methods: {
magnifyPageBlock ({ blockID, block } = {}) {
this.customBlock = block
blockID = blockID || (block || {}).blockID
this.$router.push({ query: { ...this.$route.query, blockID } })
const magnifiedBlockID = blockID || (block || {}).blockID
this.$router.push({ query: { ...this.$route.query, magnifiedBlockID } })
},
loadModal (blockID) {
Expand Down Expand Up @@ -148,7 +148,7 @@ export default {
},
hideModal () {
this.$router.push({ query: { ...this.$route.query, blockID: undefined } })
this.$router.push({ query: { ...this.$route.query, magnifiedBlockID: undefined } })
},
},
}
Expand Down

0 comments on commit 5fde4c9

Please sign in to comment.