diff --git a/source/UI/js/Form/ArrayEditable.js b/source/UI/js/Form/ArrayEditable.js index 0e583ae4..ec9a9c5f 100644 --- a/source/UI/js/Form/ArrayEditable.js +++ b/source/UI/js/Form/ArrayEditable.js @@ -142,23 +142,23 @@ Ox.ArrayEditable = function(options, self) { } that.empty(); if (self.options.items.length == 0) { - self.$items[0] = Ox.Editable({ + self.$items = [Ox.Editable({ editable: false, placeholder: self.options.placeholder, type: self.options.type, value: '' }) - .appendTo(that); + .appendTo(that)]; } else { sortItems(); - self.options.items.forEach(function(item, i) { + self.$items = self.options.items.map(function appendItem(item, i) { if (i && self.options.type == 'input') { $('') .addClass('OxSeparator') .html(self.options.separator + ' ') .appendTo(that); } - self.$items[i] = Ox.Editable({ + return Ox.Editable({ autocomplete: self.options.autocomplete, autocompleteReplace: self.options.autocompleteReplace, autocompleteReplaceCorrect: self.options.autocompleteReplaceCorrect,