From 14d12006fcb26899a8f75e89ab5815f24ddc029d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 24 Feb 2015 09:39:37 +0100 Subject: [PATCH] Fix for some weird range issues in IE 11 --- .../install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js | 2 +- wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 06df3569fd..6a136402c2 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -157,7 +157,7 @@ RedactorPlugins.wmonkeypatch = function() { } } - while ($current !== null && $current !== this.$editor[0]) { + while ($current && $current !== this.$editor[0]) { if ($current.nodeType === Node.ELEMENT_NODE) { if ($current.tagName === 'BLOCKQUOTE' || ($current.tagName === 'DIV' && /\bcodeBox\b/.test($current.className))) { var $offset = $($current).offset(); diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js index 12db841f99..6fc1eb2b21 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wutil.js @@ -751,7 +751,7 @@ RedactorPlugins.wutil = function() { if (getSelection().getRangeAt(0).collapsed) { var $startContainer = getSelection().getRangeAt(0).startContainer; - if ($startContainer.nodeType === Node.TEXT_NODE && $startContainer.textContent === '\u200b' && $startContainer.parentElement.tagName === 'P' && $startContainer.parentElement.parentElement === this.$editor[0]) { + if ($startContainer.nodeType === Node.TEXT_NODE && $startContainer.textContent === '\u200b' && $startContainer.parentElement && $startContainer.parentElement.tagName === 'P' && $startContainer.parentElement.parentElement === this.$editor[0]) { // caret position is fine return; } -- 2.20.1