From c6031daa77ee7a51fa4d0fbfd58787618810772d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 8 Sep 2016 18:05:27 +0200 Subject: [PATCH] Use `code.start()` to set initial HTML --- com.woltlab.wcf/templates/wysiwyg.tpl | 8 +++++++- wcfsetup/install/files/acp/templates/wysiwyg.tpl | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index 350fc99d44..355b27c32e 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -236,7 +236,13 @@ content = '


'; } - $(element).redactor('code.set', content); + var redactor = $(element).data('redactor'); + + // set code + redactor.code.start(content); + + // set value + redactor.core.textarea().val(redactor.clean.onSync(redactor.$editor.html())); }, 10); }; diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index 350fc99d44..355b27c32e 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -236,7 +236,13 @@ content = '


'; } - $(element).redactor('code.set', content); + var redactor = $(element).data('redactor'); + + // set code + redactor.code.start(content); + + // set value + redactor.core.textarea().val(redactor.clean.onSync(redactor.$editor.html())); }, 10); }; -- 2.20.1