From 053e800928c5d69d565b08d3b87ec25ff9ec6408 Mon Sep 17 00:00:00 2001 From: Ron Lucke Date: Thu, 20 Nov 2025 18:52:57 +0100 Subject: =?UTF-8?q?Lange=20Wiki-Seiten=20f=C3=BChren=20zu=20starker=20Eing?= =?UTF-8?q?abeverz=C3=B6gerung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #5973 Merge request studip/studip!4581 --- resources/vue/apps/WikiEditor.vue | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/resources/vue/apps/WikiEditor.vue b/resources/vue/apps/WikiEditor.vue index 30f9fd1..dda34ba 100644 --- a/resources/vue/apps/WikiEditor.vue +++ b/resources/vue/apps/WikiEditor.vue @@ -20,7 +20,7 @@

@@ -188,7 +188,7 @@ export default { }, delegateEditMode(user_id) { const url = STUDIP.URLHelper.getURL( - `dispatch.php/course/wiki/delegate_edit_mode/${this.pageId}/${user_id}`, + `dispatch.php/course/wiki/delegate_edit_mode/${this.pageId}/${user_id}` ); $.post(url).done(() => { this.isEditing = false; @@ -210,6 +210,7 @@ export default { }; if (this.autosave && this.isChanged) { + this.content = this.editor.getData(); data.content = this.content; this.isChanged = false; } @@ -230,18 +231,18 @@ export default { }, saveWikiPage() { this.toggleSecurityHandler(false); + this.content = this.editor.getData(); this.$refs.form.submit(); - } + }, }, mounted() { const textarea = this.$refs['wiki_editor']; STUDIP.wysiwyg.replace(textarea).then((editor) => { editor.model.document.on('change:data', () => { - const currentData = editor.getData(); - - this.isChanged = currentData !== this.content; - this.content = currentData; + if (!this.isChanged) { + this.isChanged = true; + } }); if (this.isEditing) { @@ -269,7 +270,7 @@ export default { this.editor.setData(content.wysiwyg); } }, - () => this.getUpdaterData(), + () => this.getUpdaterData() ); }, watch: { @@ -284,16 +285,17 @@ export default { const data = { id, type: 'config-values', - attributes: { value: current } + attributes: { value: current }, }; - STUDIP.jsonapi.withPromises() + STUDIP.jsonapi + .withPromises() .patch(`config-values/${id}`, { data: { data } }) - .then(response => { + .then((response) => { this.autosave = response.data.attributes.value; this.storingAutosave = false; }); - } + }, }, }; -- cgit v1.0