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