added filter to privilege dropdowns

This commit is contained in:
Jottyfan
2023-05-06 20:39:34 +02:00
parent d1ee923f0a
commit 5b861f730f
4 changed files with 20 additions and 4 deletions

View File

@ -5,4 +5,18 @@ class MyToggle {
toggle(divid) {
$("[id='" + divid + "']").toggle();
}
}
}
filterAllOfClass = function(filterselector, haystackselector) {
$(haystackselector).each(function() {
var t = $($(this).children()[0]).text();
var filter = $(filterselector).val();
if (filter == '' || filter == '*') {
$(this).show();
} else if (t.toUpperCase().indexOf(filter.toUpperCase()) > -1) {
$(this).show();
} else {
$(this).hide();
}
});
}