Fixed selection handling during text format
authorAlexander Ebert <ebert@woltlab.com>
Sat, 17 Dec 2016 12:42:40 +0000 (13:42 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 17 Dec 2016 12:42:40 +0000 (13:42 +0100)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Format.js

index b6df70a35e1851bdc7d48fd216756483836649b1..ea6eaddc5aec561b9e5911b45e0c6c2c0e40b599 100644 (file)
@@ -66,6 +66,10 @@ define(['Dom/Util'], function(DomUtil) {
                                // remove existing format before applying new one
                                this.removeFormat(editorElement, property);
                                
+                               range = document.createRange();
+                               range.setStartAfter(markerStart);
+                               range.setEndBefore(markerEnd);
+                               
                                selection.removeAllRanges();
                                selection.addRange(range);
                        }