Fixed mention suggestions in Internet Explorer
authorAlexander Ebert <ebert@woltlab.com>
Fri, 28 Jun 2013 16:31:05 +0000 (18:31 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 28 Jun 2013 16:31:05 +0000 (18:31 +0200)
wcfsetup/install/files/js/WCF.Message.js

index 93e4aa60a95db43002bc924d996d9c15cdd9e0a4..c7c7f335e28017dc2bad5027814fc2dd9881d0f8 100644 (file)
@@ -3026,7 +3026,16 @@ WCF.Message.UserMention = Class.extend({
                // to avoid split text nodes which were one node before inserting
                // the span element since split nodes can cause problems working
                // with ranges and remove merged text node
-               if (!$.browser.mozilla) { // firefox doesn't need this correction!
+               if ($.browser.msie) {
+                       var $next = $($element).next();
+                       var $prev = $($element).prev();
+                       
+                       if ($next.length && $prev.length) {
+                               $prev.nodeValue += $next.nodeValue;
+                               $next.remove();
+                       }
+               }
+               else if (!$.browser.mozilla) { // firefox doesn't need this correction!
                        $element.previousSibling.nodeValue += $element.nextSibling.nodeValue;
                        $($element.nextSibling).remove();
                }