mirror of
https://github.com/retspen/webvirtcloud
synced 2024-11-01 20:14:15 +00:00
18 lines
570 B
JavaScript
18 lines
570 B
JavaScript
function filter_table() {
|
|
var rex = new RegExp($(this).val(), 'i');
|
|
$('.searchable tr').hide();
|
|
$('.searchable tr').filter(function () {
|
|
return rex.test($(this).text());
|
|
}).show();
|
|
Cookies.set(document.title + "_filter", $(this).val(), { expires: 1 });
|
|
}
|
|
$(document).ready(function () {
|
|
filter_cookie = Cookies.get(document.title + "_filter");
|
|
if (filter_cookie) {
|
|
$('#filter').val(filter_cookie);
|
|
$('#filter').each(filter_table);
|
|
}
|
|
(function ($) {
|
|
$('#filter').keyup(filter_table)
|
|
}(jQuery));
|
|
});
|