From e3423595e97077fa97546b8a5898a328d0bcb025 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 13 May 2013 21:50:02 +0200 Subject: [PATCH] Improved editable item list --- wcfsetup/install/files/js/WCF.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 03acac9226..24439cbadf 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -7372,8 +7372,15 @@ WCF.EditableItemList = Class.extend({ * @param object event */ _keyDown: function(event) { + // 188 = [,] if (event === null || event.which === 188) { var $value = $.trim(this._searchInput.val()); + + // read everything left from caret position + if (event.which === 188) { + $value = $value.substring(0, this._searchInput.getCaret()); + } + if ($value === '') { return true; } @@ -7384,7 +7391,12 @@ WCF.EditableItemList = Class.extend({ }); // reset input - this._searchInput.val(''); + if (event.which === 188) { + this._searchInput.val($.trim(this._searchInput.val().substr(this._searchInput.getCaret()))); + } + else { + this._searchInput.val(''); + } if (event !== null) { event.stopPropagation(); -- 2.20.1