Adjust default content of empty editor for iOS
authorAlexander Ebert <ebert@woltlab.com>
Tue, 30 Aug 2016 11:21:00 +0000 (13:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 30 Aug 2016 11:26:15 +0000 (13:26 +0200)
com.woltlab.wcf/templates/wysiwyg.tpl
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);
                        };
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);
                        };