mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 04:26:03 +00:00
q_all/wp_all checking problem fixed
This commit is contained in:
parent
e9fdeede11
commit
9d95eedd76
20
res/app.js
20
res/app.js
@ -432,22 +432,24 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
|
||||
function updateAllCheckbox(parentFormId, checkboxClass, allCheckboxClass) {
|
||||
var allChecked = $(`#${parentFormId} ${checkboxClass}:checked`).length === $(`#${parentFormId} ${checkboxClass}`).length;
|
||||
var checkedValue = allChecked ? 'checked' : '';
|
||||
var val = allChecked ? 1 : 0;
|
||||
$(`#${parentFormId} ${allCheckboxClass}`).prop('checked', checkedValue).val(val);
|
||||
}
|
||||
|
||||
$('.wpcheck').change(function () {
|
||||
var parentFormId = $(this).closest("form").attr("id");
|
||||
var wpallChecked = $(`#${parentFormId} .wpcheck:checked`).length === $(`#${parentFormId} .wpcheck`).length;
|
||||
var wpchecked = wpallChecked ? 'checked' : '';
|
||||
var val = wpallChecked ? 1 : 0;
|
||||
$(`#${parentFormId} .wp_all`).prop('checked', wpchecked).val(val);
|
||||
updateAllCheckbox(parentFormId, '.wpcheck', '.wp_all');
|
||||
});
|
||||
|
||||
$('.qcheck').change(function () {
|
||||
var parentFormId = $(this).closest("form").attr("id");
|
||||
var qallChecked = $(`#${parentFormId} .qcheck:checked`).length === $(`#${parentFormId} .qcheck`).length;
|
||||
var qchecked = qallChecked ? 'checked' : '';
|
||||
var val = qallChecked ? 1 : 0;
|
||||
$(`#${parentFormId} .q_all`).prop('checked', qchecked).val(val);
|
||||
updateAllCheckbox(parentFormId, '.qcheck', '.q_all');
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.setallskills').change(function () {
|
||||
var value = $(this).val();
|
||||
var parentFormId = $(this).closest("form").attr("id");
|
||||
|
Loading…
Reference in New Issue
Block a user