From 84449c12330e662d522f533c567b2147ae89ed07 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 13 Dec 2014 14:35:43 +0100 Subject: [PATCH] Fixed text selection for quote in Internet Explorer --- wcfsetup/install/files/js/WCF.Message.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index 450b50f94b..19e241450f 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -1979,18 +1979,20 @@ WCF.Message.Quote.Handler = Class.extend({ * @return string */ _getNodeText: function(node) { + // work-around for IE, see http://stackoverflow.com/a/5983176 + var $nodeFilter = function(node) { + if (node.tagName === 'H3') { + return NodeFilter.FILTER_REJECT; + } + + return NodeFilter.FILTER_ACCEPT; + }; + $nodeFilter.acceptNode = $nodeFilter; + var $walker = document.createTreeWalker( node, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, - { - acceptNode: function(node) { - if (node.tagName === 'H3') { - return NodeFilter.FILTER_REJECT; - } - - return NodeFilter.FILTER_ACCEPT; - } - }, + $nodeFilter, true ); -- 2.20.1