Fix for selection missing on init
authorAlexander Ebert <ebert@woltlab.com>
Fri, 9 Sep 2016 09:01:10 +0000 (11:01 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 9 Sep 2016 09:01:48 +0000 (11:01 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Quote.js

index 7630cc74b8499a29a487a54d5c099d2d46618bcc..f073377e69877b87ad60d2d3f5ea030721a372b5 100644 (file)
@@ -60,7 +60,10 @@ define(['Core', 'EventHandler', 'EventKey', 'Language', 'StringUtil', 'Dom/Util'
                        
                        // caret must be within a `<p>`, if it is not: move it
                        var block = this._editor.selection.block();
-                       
+                       if (block === false) {
+                               this._editor.focus.end();
+                               block = this._editor.selection.block();
+                       }
                        
                        while (block && block.parentNode !== editor) {
                                block = block.parentNode;