Adjust default content of empty editor for iOS
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / acp / templates / wysiwyg.tpl
index b4a15e2d096bc7916d567d9476c31005cb94b226..b8a52b2ad4dd5e4622530289c80dac40b49d6f43 100644 (file)
@@ -46,7 +46,7 @@
                
                {event name='redactorJavaScript'}
        ], function () {
-               require(['Language', 'WoltLabSuite/Core/Ui/Redactor/Autosave', 'WoltLabSuite/Core/Ui/Redactor/Metacode'], function(Language, UiRedactorAutosave, UiRedactorMetacode) {
+               require(['Environment', 'Language', 'WoltLabSuite/Core/Ui/Redactor/Autosave', 'WoltLabSuite/Core/Ui/Redactor/Metacode'], function(Environment, Language, UiRedactorAutosave, UiRedactorMetacode) {
                        Language.addObject({
                                'wcf.editor.code.edit': '{lang}wcf.editor.code.edit{/lang}',
                                'wcf.editor.code.file': '{lang}wcf.editor.code.file{/lang}',
                        config.callbacks.init = function() {
                                // slight delay to allow Redactor to initialize itself
                                window.setTimeout(function() {
+                                       if (content === '' && Environment.platform() === 'ios') {
+                                               content = '<p><br></p>';
+                                       }
+                                       
                                        $(element).redactor('code.set', content);
                                }, 10);
                        };