Skip to content

Commit 0675858

Browse files
authored
Merge pull request #6570 from nextcloud/backport/6560/stable30
[stable30] feat(editorApi): Add function to allow setting readonly bar props
2 parents 2c13c66 + 9510d5c commit 0675858

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/editor.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ACTION_ATTACHMENT_PROMPT } from './components/Editor/MediaHandler.provi
1111
// eslint-disable-next-line import/no-unresolved, n/no-missing-import
1212
import 'vite/modulepreload-polyfill'
1313

14-
const apiVersion = '1.1'
14+
const apiVersion = '1.2'
1515

1616
Vue.prototype.t = window.t
1717
Vue.prototype.n = window.n
@@ -119,6 +119,11 @@ class TextEditorEmbed {
119119
return this
120120
}
121121

122+
updateReadonlyBarProps(value) {
123+
this.#vm.$set(this.#data, 'readonlyBarProps', value)
124+
return this
125+
}
126+
122127
insertAtCursor(content) {
123128
this.#getEditorComponent().$editor.chain().insertContent(content).focus().run()
124129
}
@@ -174,6 +179,7 @@ window.OCA.Text.createEditor = async function({
174179

175180
const data = Vue.observable({
176181
showOutlineOutside: false,
182+
readonlyBarProps: readonlyBar.props,
177183
readOnly,
178184
content,
179185
})
@@ -205,7 +211,7 @@ window.OCA.Text.createEditor = async function({
205211
? {
206212
readonlyBar: () => {
207213
return h(readonlyBar.component, {
208-
props: readonlyBar.props,
214+
props: data.readonlyBarProps,
209215
})
210216
},
211217
}

0 commit comments

Comments
 (0)