mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-08 10:18:50 +01:00
commit
50421fc19b
8 changed files with 63 additions and 13 deletions
|
|
@ -184,5 +184,21 @@ var TracksPages = {
|
|||
|
||||
/* fade flashes and alerts in automatically */
|
||||
$(".alert").fadeOut(8000);
|
||||
}, sort_container: function(container) {
|
||||
function comparator(a, b) {
|
||||
var contentA = $(a).attr('data-sort') || '';
|
||||
var contentB = $(b).attr('data-sort') || '';
|
||||
if (contentA > contentB) {
|
||||
return 1;
|
||||
}
|
||||
if (contentB > contentA) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
var unsortedActions = container.children();
|
||||
var sortedChildren = unsortedActions.sort(comparator);
|
||||
container.append(sortedChildren);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue