From dd4d744595507a1e8a192289d79991e4925466f5 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 15 Feb 2018 15:40:59 +0100 Subject: [PATCH] `selection.saveInstant()` was missing the return value --- .../js/3rdParty/redactor2/plugins/WoltLabCaret.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js index 59e33c6a03..07eacfdd4e 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabCaret.js @@ -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; -- 2.20.1