Fixed the cookie/filter thing
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine 2024-05-25 11:47:57 -04:00
parent 94c1c26e94
commit 8c1c43e4df

View File

@ -1,18 +1,14 @@
$(document).ready(function() {
$('#filter-limit').on('change', () => {
$.cookie('filter_limit', $('#filter-limit').val());
$('#filter-form').submit();
});
// check state of limit filter
var cookie_limit = $.cookie('filter_limit');
// if limit is different than what's selected
var active_limit = $('#filter-limit').val();
if ((cookie_limit) && (cookie_limit != active_limit)) {
console.log('cookie is different from whats active.');
$('#filter-limit').val(cookie_limit).change();
} else {
console.log('cookie is not set or is the same.');
$('#filter-limit').val(cookie_limit).trigger('change');
}
$('#filter-limit').on('change', () => {
$.cookie('filter_limit', $('#filter-limit').val());
console.log($('#filter-limit').val());
$('#filter-form').submit();
});
});