Fixed tristate inputs (used for permissions input)

This commit is contained in:
Jan Böhmer 2022-07-24 21:12:11 +02:00
parent f06ad01eb2
commit 9ed487c629
7 changed files with 67 additions and 35 deletions

View file

@ -5,7 +5,6 @@ import "bootstrap-fileinput/css/fileinput.css"
//JS
import "./lib/jquery.tristate"
import "bootstrap-fileinput";
@ -14,8 +13,6 @@ const RegisterEventHelper = class {
constructor() {
this.registerTooltips();
this.registerJumpToTopBtn();
this.registerTriStateCheckboxes();
this.registerFileInput();
this.registerSpecialCharInput();
@ -67,27 +64,6 @@ const RegisterEventHelper = class {
});
}
registerTriStateCheckboxes() {
this.registerLoadHandler(() => {
$(".tristate").tristate( {
checked: "true",
unchecked: "false",
indeterminate: "indeterminate",
});
$('.permission_multicheckbox:checkbox').change(function() {
//Find the other checkboxes in this row, and change their value
var $row = $(this).parents('tr');
//@ts-ignore
var new_state = $(this).tristate('state');
//@ts-ignore
$('.tristate:checkbox', $row).tristate('state', new_state);
});
})
}
registerSpecialCharInput() {
this.registerLoadHandler(() => {
//@ts-ignore