use [].concat, not Ox.merge
This commit is contained in:
parent
36d0162b8b
commit
1c40fb007b
27 changed files with 87 additions and 90 deletions
|
|
@ -121,10 +121,9 @@ Ox.IconList = function(options, self) {
|
|||
|
||||
function updateKeys() {
|
||||
that.$element.options({
|
||||
keys: Ox.unique(Ox.merge(
|
||||
self.options.sort[0].key,
|
||||
self.options.keys
|
||||
))
|
||||
keys: Ox.unique(
|
||||
[self.options.sort[0].key].concat(self.options.keys)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,10 +148,9 @@ Ox.InfoList = function(options, self) {
|
|||
|
||||
function updateKeys() {
|
||||
that.$element.options({
|
||||
keys: Ox.unique(Ox.merge(
|
||||
self.options.sort[0].key,
|
||||
self.options.keys
|
||||
))
|
||||
keys: Ox.unique(
|
||||
[self.options.sort[0].key].concat(self.options.keys)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -784,10 +784,10 @@ Ox.List = function(options, self) {
|
|||
return;
|
||||
}
|
||||
Ox.Log('List', that.oxid, 'loadPage', page);
|
||||
var keys = Ox.merge(
|
||||
self.options.keys.indexOf(self.options.unique) == -1
|
||||
? [self.options.unique] : [], self.options.keys
|
||||
),
|
||||
var keys = (
|
||||
self.options.keys.indexOf(self.options.unique == -1)
|
||||
? [self.options.unique] : []
|
||||
).concat(self.options.keys),
|
||||
offset = page * self.pageLength,
|
||||
range = [offset, offset + getPageLength(page)];
|
||||
if (Ox.isUndefined(self.$pages[page])) { // fixme: unload will have made this undefined already
|
||||
|
|
@ -1459,8 +1459,8 @@ Ox.List = function(options, self) {
|
|||
$item.insertAfter($items[i - 1]);
|
||||
}
|
||||
});
|
||||
self.options.items.splice.apply(self.options.items, Ox.merge([pos, 0], items));
|
||||
self.$items.splice.apply(self.$items, Ox.merge([pos, 0], $items));
|
||||
self.options.items.splice.apply(self.options.items, [pos, 0].concat(items));
|
||||
self.$items.splice.apply(self.$items, [pos, 0].concat($items));
|
||||
self.listLength = self.options.items.length;
|
||||
//loadItems();
|
||||
updatePositions();
|
||||
|
|
|
|||
|
|
@ -204,9 +204,9 @@ Ox.TextList = function(options, self) {
|
|||
items: self.options.items,
|
||||
itemWidth: getItemWidth(),
|
||||
format: self.format, // fixme: not needed, happens in TextList
|
||||
keys: Ox.merge(self.visibleColumns.map(function(column) {
|
||||
keys: self.visibleColumns.map(function(column) {
|
||||
return column.id;
|
||||
}), self.options.keys),
|
||||
}).concat(self.options.keys),
|
||||
max: self.options.max,
|
||||
min: self.options.min,
|
||||
pageLength: self.options.pageLength,
|
||||
|
|
@ -268,9 +268,9 @@ Ox.TextList = function(options, self) {
|
|||
that.$head.$content.empty();
|
||||
constructHead();
|
||||
that.$body.options({
|
||||
keys: Ox.merge(self.visibleColumns.map(function(column) {
|
||||
keys: self.visibleColumns.map(function(column) {
|
||||
return column.id;
|
||||
}), self.options.keys)
|
||||
}).concat(self.options.keys)
|
||||
});
|
||||
that.$body.reloadPages();
|
||||
}
|
||||
|
|
@ -592,7 +592,7 @@ Ox.TextList = function(options, self) {
|
|||
value = (
|
||||
/^color/.test(format.type.toLowerCase()) ? Ox.Theme : Ox
|
||||
)['format' + Ox.toTitleCase(format.type)].apply(
|
||||
this, Ox.merge([value], format.args || [])
|
||||
this, [value].concat(format.args || [])
|
||||
);
|
||||
} else {
|
||||
value = format(value, data);
|
||||
|
|
@ -719,9 +719,9 @@ Ox.TextList = function(options, self) {
|
|||
width: itemWidth + 'px'
|
||||
});
|
||||
that.$body.options({
|
||||
keys: Ox.merge(self.visibleColumns.map(function(column) {
|
||||
keys: self.visibleColumns.map(function(column) {
|
||||
return column.id;
|
||||
}), self.options.keys)
|
||||
}).concat(self.options.keys)
|
||||
});
|
||||
//that.$body.clearCache();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,7 +190,9 @@ Ox.TreeList = function(options, self) {
|
|||
: {}
|
||||
);
|
||||
ret.push(item_);
|
||||
item.items && Ox.merge(ret, item_.items);
|
||||
if (item.items) {
|
||||
ret = ret.concat(item_.items);
|
||||
}
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue