Fixed text selection triggering caret reposition
authorAlexander Ebert <ebert@woltlab.com>
Sun, 25 Sep 2016 15:47:48 +0000 (17:47 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 25 Sep 2016 15:47:54 +0000 (17:47 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js

index 98af8cefacc63ebab01a867cd2caf11446d91919..c6da5149ab9c18551541785c5c7602dd5e6622f8 100644 (file)
@@ -185,6 +185,11 @@ $.Redactor.prototype.WoltLabCaret = function() {
                },
                
                _handleEditorClick: function (event) {
+                       if (!this.selection.get().isCollapsed) {
+                               // ignore text selection
+                               return;
+                       }
+                       
                        var block = this.selection.block();
                        if (block === false) {
                                // check if the caret is now in a <p> before a <table>