1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-26 16:15:25 +00:00
webvirtcloud/static/js/filter-table.js

19 lines
584 B
JavaScript
Raw Normal View History

function filter_table() {
var rex = new RegExp($(this).val(), 'i');
$('.searchable tr').hide();
$('.searchable tr').filter(function () {
return rex.test($(this).text());
}).show();
2020-07-13 09:33:09 +00:00
Cookies.set("instances_filter", $(this).val(), { expires: 1 });
}
$(document).ready(function () {
2020-07-13 09:33:09 +00:00
instances_filter_cookie = Cookies.get("instances_filter");
if (instances_filter_cookie) {
$('#filter').val(instances_filter_cookie);
$('#filter').each(filter_table);
}
(function ($) {
$('#filter').keyup(filter_table)
}(jQuery));
});