diff --git a/src/editor.js b/src/editor.js index 523ed0eb412..885455a2a3c 100644 --- a/src/editor.js +++ b/src/editor.js @@ -27,7 +27,7 @@ import { ACTION_ATTACHMENT_PROMPT } from './components/Editor/MediaHandler.provi __webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-line __webpack_public_path__ = OC.linkTo('text', 'js/') // eslint-disable-line -const apiVersion = '1.1' +const apiVersion = '1.2' Vue.prototype.t = window.t Vue.prototype.n = window.n @@ -115,6 +115,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() } @@ -169,6 +174,7 @@ window.OCA.Text.createEditor = async function({ const data = Vue.observable({ showOutlineOutside: false, + readonlyBarProps: readonlyBar.props, readOnly, content, }) @@ -200,7 +206,7 @@ window.OCA.Text.createEditor = async function({ ? { readonlyBar: () => { return h(readonlyBar.component, { - props: readonlyBar.props, + props: data.readonlyBarProps, }) }, }