Skip to content

Commit

Permalink
feat(editorApi): Add function to allow setting readonly bar props
Browse files Browse the repository at this point in the history
Required to tackle nextcloud/collectives#1371

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- committed Oct 23, 2024
1 parent 03732b7 commit 5092598
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ class TextEditorEmbed {
return this
}

updateReadonlyBarProps(value) {
this.#vm.$set(this.#data, 'readonlyBarProps', value)
return this
}

insertAtCursor(content) {
this.#getEditorComponent().$editor.chain().insertContent(content).focus().run()
}
Expand Down Expand Up @@ -174,6 +179,7 @@ window.OCA.Text.createEditor = async function({

const data = Vue.observable({
showOutlineOutside: false,
readonlyBarProps: readonlyBar.props,
readOnly,
content,
})
Expand Down Expand Up @@ -205,7 +211,7 @@ window.OCA.Text.createEditor = async function({
? {
readonlyBar: () => {
return h(readonlyBar.component, {
props: readonlyBar.props,
props: data.readonlyBarProps,
})
},
}
Expand Down

0 comments on commit 5092598

Please sign in to comment.