From 8717050fefe848029e9c25f187e956536283da78 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 21 May 2012 01:36:26 +0200 Subject: [PATCH] Fixed a few issues with editable item lists in JS --- wcfsetup/install/files/js/WCF.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index a24b7a8d0a..93a9e3b3ef 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -5564,6 +5564,9 @@ WCF.EditableItemList = Class.extend({ label: self._searchInput.val() }); + // reset input + $(this).val(''); + event.stopPropagation(); return false; } @@ -5627,7 +5630,9 @@ WCF.EditableItemList = Class.extend({ */ addItem: function(data) { if (this._data[data.objectID]) { - return true; + if (!(data.objectID === 0 && this._allowCustomInput)) { + return true; + } } var $listItem = $('
  • ' + data.label + '
  • ').data('objectID', data.objectID).data('label', data.label).appendTo(this._itemList); -- 2.20.1