Fixes issue with user mention suggestions
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 Sep 2013 07:52:43 +0000 (09:52 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 Sep 2013 07:52:43 +0000 (09:52 +0200)
wcfsetup/install/files/js/WCF.Message.js

index 95c4d3b80fbb8f21357e34f0863d41e7916d2c77..f27a3221d227d402f28130d6dcdd60c85cbd3d60 100644 (file)
@@ -3130,13 +3130,16 @@ WCF.Message.UserMention = Class.extend({
                $text = '';
                for (var $i = 0; $i < $textBackup.length; $i++) {
                        var $byte = $textBackup.charCodeAt($i).toString(16);
-                       if ($byte != '200b' && $byte != 'a0') {
+                       if ($byte != '200b' && !$textBackup.charAt($i).match(/\s/)) {
                                if ($textBackup[$i] === '@' && $i && $textBackup[$i - 1].match(/\s/)) {
                                        $text = '';
                                }
                                
                                $text += $textBackup[$i];
                        }
+                       else {
+                               $text = '';
+                       }
                }
                
                return $text;