mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-31 07:18:21 -04:00
Small improvments in sorting.
This commit is contained in:
parent
a447502703
commit
3a92606e0c
4 changed files with 17 additions and 19 deletions
|
@ -65,7 +65,14 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
|||
|
||||
$all.removeClass('ascending').removeClass('descending');
|
||||
order.head.addClass(order.clas);
|
||||
$('#items .item').detach().sort(order.fn).appendTo('#items');
|
||||
var current = $('#items .item');
|
||||
var sorted = $('#items .item').sort(order.fn);
|
||||
for (var i = 0, l = current.length; i < l; i += 1) {
|
||||
if (current[i] !== sorted[i]) {
|
||||
sorted.detach().sort(order.fn).appendTo('#items');
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onContentChanged = function (item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue