From: Matthias Schmidt Date: Sat, 9 Nov 2013 17:50:24 +0000 (+0100) Subject: Fixes array index issue in tagging JavaScript X-Git-Tag: 2.0.0_RC_2~40 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=490a21ac67f4fdb8457d068af3b8321ce8a6e941;p=GitHub%2FWoltLab%2FWCF.git Fixes array index issue in tagging JavaScript --- diff --git a/wcfsetup/install/files/js/WCF.Tagging.js b/wcfsetup/install/files/js/WCF.Tagging.js index d12233debf..828de7241a 100644 --- a/wcfsetup/install/files/js/WCF.Tagging.js +++ b/wcfsetup/install/files/js/WCF.Tagging.js @@ -133,7 +133,9 @@ WCF.Tagging.TagList = WCF.EditableItemList.extend({ _removeItem: function(objectID, label) { for (var $i = 0, $length = this._data.length; $i < $length; $i++) { if (this._data[$i] === label) { - delete this._data[$i]; + // don't use "delete" here since it doesn't reindex + // the array + this._data.splice($i, 1); return; } } @@ -168,4 +170,4 @@ WCF.Tagging.TagSearch = WCF.Search.Base.extend({ init: function(searchInput, callback, excludedSearchValues, commaSeperated) { this._super(searchInput, callback, excludedSearchValues, commaSeperated, false); } -}); \ No newline at end of file +});