From: Alexander Ebert Date: Sun, 20 May 2012 23:36:26 +0000 (+0200) Subject: Fixed a few issues with editable item lists in JS X-Git-Tag: 2.0.0_Beta_1~1100 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8717050fefe848029e9c25f187e956536283da78;p=GitHub%2FWoltLab%2FWCF.git Fixed a few issues with editable item lists in JS --- 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);