Fixes array index issue in tagging JavaScript
authorMatthias Schmidt <gravatronics@live.com>
Sat, 9 Nov 2013 17:50:24 +0000 (18:50 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 9 Nov 2013 17:50:24 +0000 (18:50 +0100)
wcfsetup/install/files/js/WCF.Tagging.js

index d12233debfea95859ff082c3c914c02352ab8ece..828de7241a50e4e90219feef02d5cea74d2f375b 100644 (file)
@@ -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
+});