Use `code.start()` to set initial HTML
authorAlexander Ebert <ebert@woltlab.com>
Thu, 8 Sep 2016 16:05:27 +0000 (18:05 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 8 Sep 2016 16:05:27 +0000 (18:05 +0200)
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/acp/templates/wysiwyg.tpl

index 350fc99d440364ddcd0c57fe3340fcc6506fcf92..355b27c32e2c0293a49990d128c5398c553ec43d 100644 (file)
                                                content = '<p><br></p>';
                                        }
                                        
-                                       $(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);
                        };
                        
index 350fc99d440364ddcd0c57fe3340fcc6506fcf92..355b27c32e2c0293a49990d128c5398c553ec43d 100644 (file)
                                                content = '<p><br></p>';
                                        }
                                        
-                                       $(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);
                        };