diff --git a/client/web/compose/src/components/ModuleFields/Editor/base.vue b/client/web/compose/src/components/ModuleFields/Editor/base.vue index e54b2a983..4eb1aa9aa 100644 --- a/client/web/compose/src/components/ModuleFields/Editor/base.vue +++ b/client/web/compose/src/components/ModuleFields/Editor/base.vue @@ -136,6 +136,13 @@ export default { return edit || view }, + + // detect when a page block is opened in a modal through magnification or record open type + inModal () { + const { recordPageID, magnifiedBlockID } = this.$route.query + + return !!recordPageID || !!magnifiedBlockID + }, }, } diff --git a/client/web/compose/src/components/ModuleFields/Viewer/Record.vue b/client/web/compose/src/components/ModuleFields/Viewer/Record.vue index 42466ec25..337a21bd1 100644 --- a/client/web/compose/src/components/ModuleFields/Viewer/Record.vue +++ b/client/web/compose/src/components/ModuleFields/Viewer/Record.vue @@ -198,7 +198,7 @@ export default { onRecordSelectorClick (e, route) { e.preventDefault() - if (this.extraOptions.recordSelectorDisplayOption === 'modal') { + if (this.extraOptions.recordSelectorDisplayOption === 'modal' || this.inModal) { this.$root.$emit('show-record-modal', { recordID: route.params.recordID, recordPageID: route.params.pageID, diff --git a/client/web/compose/src/components/ModuleFields/Viewer/base.vue b/client/web/compose/src/components/ModuleFields/Viewer/base.vue index 3c2c466bc..569cfa2fa 100644 --- a/client/web/compose/src/components/ModuleFields/Viewer/base.vue +++ b/client/web/compose/src/components/ModuleFields/Viewer/base.vue @@ -76,6 +76,13 @@ export default { options () { return this.field.options }, + + // detect when a page block is opened in a modal through magnification or record open type + inModal () { + const { recordPageID, magnifiedBlockID } = this.$route.query + + return !!recordPageID || !!magnifiedBlockID + }, }, } diff --git a/client/web/compose/src/components/PageBlocks/CalendarBase.vue b/client/web/compose/src/components/PageBlocks/CalendarBase.vue index c33ab36c9..49ea56dd3 100644 --- a/client/web/compose/src/components/PageBlocks/CalendarBase.vue +++ b/client/web/compose/src/components/PageBlocks/CalendarBase.vue @@ -382,18 +382,13 @@ export default { const route = { name: 'page.record', params: { recordID, pageID: page.pageID } } - if (this.inModal) { + if (this.options.eventDisplayOption === 'modal' || this.inModal) { this.$root.$emit('show-record-modal', { recordID, recordPageID: page.pageID, }) } else if (this.options.eventDisplayOption === 'newTab') { window.open(this.$router.resolve(route).href) - } else if (this.options.eventDisplayOption === 'modal') { - this.$root.$emit('show-record-modal', { - recordID, - recordPageID: page.pageID, - }) } else { this.$router.push(route) } diff --git a/client/web/compose/src/components/PageBlocks/GeometryBase.vue b/client/web/compose/src/components/PageBlocks/GeometryBase.vue index f95656036..3f397466a 100644 --- a/client/web/compose/src/components/PageBlocks/GeometryBase.vue +++ b/client/web/compose/src/components/PageBlocks/GeometryBase.vue @@ -255,18 +255,13 @@ export default { const route = { name: 'page.record', params: { recordID, pageID: page.pageID } } - if (this.inModal) { + if (this.options.displayOption === 'modal' || this.inModal) { this.$root.$emit('show-record-modal', { recordID, recordPageID: page.pageID, }) } else if (this.options.displayOption === 'newTab') { window.open(this.$router.resolve(route).href) - } else if (this.options.displayOption === 'modal') { - this.$root.$emit('show-record-modal', { - recordID, - recordPageID: page.pageID, - }) } else { this.$router.push(route) } diff --git a/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue b/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue index e5ab70928..6f6fcae1b 100644 --- a/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue +++ b/client/web/compose/src/components/PageBlocks/RecordOrganizerBase.vue @@ -349,7 +349,7 @@ export default { values[groupField] = group } - if (this.inModal) { + if (this.options.displayOption === 'modal' || this.inModal) { this.$root.$emit('show-record-modal', { recordID: NoID, recordPageID: (this.roRecordPage || {}).pageID,