Skip to content

Commit 5c2c58d

Browse files
committed
Fix: inContentEditor computed
1 parent 3554e20 commit 5c2c58d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

frontend/js/components/Repeater.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
nested_block_name: this.name + '|',
129129
}
130130
},
131+
inject: ['inContentEditor'],
131132
computed: {
132133
triggerVariant: function () {
133134
if (this.buttonAsLink) {
@@ -141,9 +142,6 @@
141142
blockSize: function () {
142143
return this.inContentEditor ? 'small' : ''
143144
},
144-
inContentEditor: function () {
145-
return typeof this.$parent.repeaterName !== 'undefined'
146-
},
147145
hasRemainingBlocks: function () {
148146
let max = null
149147
if (this.max && this.max > 0) {

frontend/js/mixins/blockEditor.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export default {
1515
default: 0
1616
}
1717
},
18+
provide() {
19+
return {
20+
inContentEditor: true,
21+
}
22+
},
1823
methods: {
1924
addAndEditBlock (add, edit, { block, index }) {
2025
window[process.env.VUE_APP_NAME].PREVSTATE = cloneDeep(this.$store.state)

0 commit comments

Comments
 (0)