From: Alexander Ebert Date: Tue, 24 Feb 2015 08:39:37 +0000 (+0100) Subject: Fix for some weird range issues in IE 11 X-Git-Tag: 2.1.0~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=14d12006fcb26899a8f75e89ab5815f24ddc029d;p=GitHub%2FWoltLab%2FWCF.git Fix for some weird range issues in IE 11 --- 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; }