Fixed [Enter] key for editable item lists in Firefox
authorAlexander Ebert <ebert@woltlab.com>
Sat, 11 Apr 2015 21:43:07 +0000 (23:43 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 11 Apr 2015 21:43:07 +0000 (23:43 +0200)
event.charCode is 0 for enter in Firefox

wcfsetup/install/files/js/WCF.js

index cde4d8da72e655cdaf161c2d37ca2192ed822e10..050b859f841690def157991265529a87e02ddd56 100755 (executable)
@@ -10264,7 +10264,7 @@ WCF.EditableItemList = Class.extend({
         */
        _keyPress: function(event) {
                // 44 = [,] (charCode != keyCode)
-               if (event === null || event.charCode === 44 || event.charCode === $.ui.keyCode.ENTER) {
+               if (event === null || event.charCode === 44 || event.charCode === $.ui.keyCode.ENTER || ($.browser.mozilla && event.keyCode === $.ui.keyCode.ENTER)) {
                        if (event !== null && event.charCode === $.ui.keyCode.ENTER && this._search) {
                                if (this._search._itemIndex !== -1) {
                                        return false;
@@ -10277,7 +10277,7 @@ WCF.EditableItemList = Class.extend({
                        if (event && event.charCode === 44) {
                                $value = $value.substring(0, this._searchInput.getCaret());
                        }
-                       
+                       console.debug($value);
                        if ($value === '') {
                                return true;
                        }