From: Alexander Ebert Date: Thu, 8 Sep 2016 16:05:27 +0000 (+0200) Subject: Use `code.start()` to set initial HTML X-Git-Tag: 3.0.0_Beta_1~258 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c6031daa77ee7a51fa4d0fbfd58787618810772d;p=GitHub%2FWoltLab%2FWCF.git Use `code.start()` to set initial HTML --- 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); };