mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 19:05:32 -04:00
16 lines
390 B
JavaScript
16 lines
390 B
JavaScript
$(() => {
|
|
$('#sort-select').change(() => {
|
|
const sort = $('#sort-select').find(':selected').attr('id');
|
|
const ary = sort.split('-');
|
|
const by = ary[0];
|
|
const dir = ary[1];
|
|
|
|
const url = `${location.protocol}//${location.host}${location.pathname}`;
|
|
const newURL = `${url}?${$.param({
|
|
sort: by,
|
|
ascend: dir === 'up' ? 1 : 0
|
|
})}`;
|
|
window.location.href = newURL;
|
|
});
|
|
});
|