`selection.saveInstant()` was missing the return value
authorAlexander Ebert <ebert@woltlab.com>
Thu, 15 Feb 2018 14:40:59 +0000 (15:40 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 15 Feb 2018 14:40:59 +0000 (15:40 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js

index 59e33c6a039dd2e095929f3c2123bc71fbd813fd..07eacfdd4e15ee530e07b100c216ac3cbb0c90bb 100644 (file)
@@ -68,19 +68,21 @@ $.Redactor.prototype.WoltLabCaret = function() {
                        
                        var mpSaveInstant = this.selection.saveInstant;
                        this.selection.saveInstant = (function() {
-                               mpSaveInstant.call(this);
+                               var saved = mpSaveInstant.call(this);
                                
-                               if (this.saved) {
-                                       this.saved.isAtNodeStart = false;
+                               if (saved) {
+                                       saved.isAtNodeStart = false;
                                        
                                        var selection = window.getSelection();
                                        if (selection.rangeCount && !selection.isCollapsed) {
                                                var range = selection.getRangeAt(0);
                                                if (range.startContainer.nodeType === Node.TEXT_NODE && range.startOffset === 0) {
-                                                       this.saved.isAtNodeStart = true;
+                                                       saved.isAtNodeStart = true;
                                                }
                                        }
                                }
+                               
+                               return saved;
                        }).bind(this);
                        
                        var mpRestoreInstant = this.selection.restoreInstant;