... ... @@ -120,17 +120,6 @@
120 120 }
121 121
122 122 function createEditors(ckeditor, container, config) {
123 - if (config.editorName) {
124 - // We cannot set the editor name through the editor configuration. The editor name is taken by default from the
125 - // container id or name. To overcome this we set the editor name just after the editor instance is created.
126 - const handler = ckeditor.on('instanceCreated', event => {
127 - if (event.editor.element.$ === container[0]) {
128 - event.editor.name = config.editorName;
129 - handler.removeListener();
130 - }
131 - });
132 - }
133 -
134 134 container.attr({
135 135 'data-sourceDocumentReference': XWiki.Model.serialize(config.document.documentReference),
136 136 'data-syntax': config.document.syntax
... ... @@ -147,6 +147,17 @@
147 147 }
148 148
149 149 function createEditor(ckeditor, element, config, instanceConfig) {
139 + if (config.editorName) {
140 + // We cannot set the editor name through the editor configuration. The editor name is taken by default from the
141 + // element id or name. To overcome this we set the editor name just after the editor instance is created.
142 + const handler = ckeditor.on('instanceCreated', event => {
143 + if (event.editor.element.$ === element) {
144 + event.editor.name = config.editorName;
145 + handler.removeListener();
146 + }
147 + });
148 + }
149 +
150 150 let stopAvoidingCKAndSaveBarOverlap = null;
151 151 const fieldSet = createFieldSet(element.ownerDocument, config);
152 152 const deferred = $.Deferred();
but this raises other issues:
[minor] The update of the document syntax field (from the Information tab) increments the document version but the in-place editor is not aware of it. You get a merge conflict as a result on the next (auto)save from the WYSIWYG editor. This can be fixed by modifying editableProperty.js to trigger the xwiki:document:changeVersion event, but we can't call meta'ssetVersion unless the edited property is from the current document, which might not be always the case (it's possible to edit on page X a property from page Y).
[major] The syntax change is not propagated by the realtime session. Currently, only the edited content is synchronized. This means the other users editing at the same time will get the new content resulted from the syntax conversion, but their edit form will still submit the old syntax, which can create a mess...
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.