3
0

Fix Use Magnifying Glass in Page Builder

This commit is contained in:
Atanas Yonkov 2023-03-14 11:56:10 +02:00
parent e7c2fdcb11
commit d84a0a7217
3 changed files with 15 additions and 8 deletions

View File

@ -99,18 +99,20 @@ export default {
},
created () {
this.$root.$on('magnify-page-block', ({ blockID, block } = {}) => {
this.customBlock = block
blockID = blockID || (block || {}).blockID
this.$router.push({ query: { ...this.$route.query, blockID } })
})
this.$root.$on('magnify-page-block', this.magnifyPageBlock)
},
beforeDestroy () {
this.$root.$off('magnify-page-block')
destroyed () {
this.$root.$off('magnify-page-block', this.magnifyPageBlock)
},
methods: {
magnifyPageBlock ({ blockID, block } = {}) {
this.customBlock = block
blockID = blockID || (block || {}).blockID
this.$router.push({ query: { ...this.$route.query, blockID } })
},
loadModal (blockID) {
// Get data from route
const { recordID: paramsRecordID, pageID } = this.$route.params

View File

@ -262,6 +262,10 @@
</template>
</editor-toolbar>
</portal>
<magnification-modal
:namespace="namespace"
/>
</div>
</template>
@ -276,6 +280,7 @@ import EditorToolbar from 'corteza-webapp-compose/src/components/Admin/EditorToo
import { compose, NoID } from '@cortezaproject/corteza-js'
import Configurator from 'corteza-webapp-compose/src/components/PageBlocks/Configurator'
import { fetchID } from 'corteza-webapp-compose/src/lib/tabs'
import MagnificationModal from 'corteza-webapp-compose/src/components/Public/Page/Block/Modal'
export default {
i18nOptions: {
@ -289,6 +294,7 @@ export default {
PageBlock,
EditorToolbar,
PageTranslator,
MagnificationModal,
},
mixins: [

View File

@ -71,7 +71,6 @@
<magnification-modal
:namespace="namespace"
:page="page"
/>
</div>
</template>