mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 19:34:31 +02:00
Fixed tristate inputs (used for permissions input)
This commit is contained in:
parent
f06ad01eb2
commit
9ed487c629
7 changed files with 67 additions and 35 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue