in Ox.api, only sort if more than two items

This commit is contained in:
rolux 2012-04-01 23:02:19 +02:00
parent cd6bca7d6b
commit 803985a160

View file

@ -235,7 +235,7 @@ Ox.api = function(items, options) {
} else { } else {
result.data.items = Ox.clone(items); result.data.items = Ox.clone(items);
} }
if (options.sort) { if (options.sort && result.data.items.length > 1) {
// sort // sort
options.sort = parseSort(Ox.merge(options.sort, api.sort)); options.sort = parseSort(Ox.merge(options.sort, api.sort));
options.sort.forEach(function(v) { options.sort.forEach(function(v) {