mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
only add the default sorter once.
This commit is contained in:
parent
2bf2469657
commit
a4f15ffe15
@ -279,9 +279,11 @@ function sortGarage(sender, isMobile) {
|
||||
sender.addClass('sort-asc');
|
||||
sender.html(isMobile ? `<span class="ms-2 display-3">${garageIcon}${sortColumn}${sortAscIcon}</span>` : `${garageIcon}${sortColumn}${sortAscIcon}`);
|
||||
//append sortRowId to the vehicle container
|
||||
$(`.garage-item`).map((index, elem) => {
|
||||
$(elem).attr("default-sort", index);
|
||||
});
|
||||
if ($("[default-sort]").length == 0) {
|
||||
$(`.garage-item`).map((index, elem) => {
|
||||
$(elem).attr("default-sort", index);
|
||||
});
|
||||
}
|
||||
sortVehicles(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,10 +446,12 @@ function toggleSort(tabName, sender) {
|
||||
}
|
||||
sender.addClass('sort-asc');
|
||||
sender.html(`${sortColumn}${sortAscIcon}`);
|
||||
//append sortRowId to the table rows.
|
||||
$(`#${tabName} table tbody tr`).map((index, elem) => {
|
||||
$(elem).attr("default-sort", index);
|
||||
});
|
||||
//append sortRowId to the table rows if nothing has been appended yet.
|
||||
if ($("[default-sort]").length == 0) {
|
||||
$(`#${tabName} table tbody tr`).map((index, elem) => {
|
||||
$(elem).attr("default-sort", index);
|
||||
});
|
||||
}
|
||||
sortTable(tabName, sortColumn, false);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user