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 () {
|
$('.wpcheck').change(function () {
|
||||||
var parentFormId = $(this).closest("form").attr("id");
|
var parentFormId = $(this).closest("form").attr("id");
|
||||||
var wpallChecked = $(`#${parentFormId} .wpcheck:checked`).length === $(`#${parentFormId} .wpcheck`).length;
|
updateAllCheckbox(parentFormId, '.wpcheck', '.wp_all');
|
||||||
var wpchecked = wpallChecked ? 'checked' : '';
|
|
||||||
var val = wpallChecked ? 1 : 0;
|
|
||||||
$(`#${parentFormId} .wp_all`).prop('checked', wpchecked).val(val);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.qcheck').change(function () {
|
$('.qcheck').change(function () {
|
||||||
var parentFormId = $(this).closest("form").attr("id");
|
var parentFormId = $(this).closest("form").attr("id");
|
||||||
var qallChecked = $(`#${parentFormId} .qcheck:checked`).length === $(`#${parentFormId} .qcheck`).length;
|
updateAllCheckbox(parentFormId, '.qcheck', '.q_all');
|
||||||
var qchecked = qallChecked ? 'checked' : '';
|
|
||||||
var val = qallChecked ? 1 : 0;
|
|
||||||
$(`#${parentFormId} .q_all`).prop('checked', qchecked).val(val);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('.setallskills').change(function () {
|
$('.setallskills').change(function () {
|
||||||
var value = $(this).val();
|
var value = $(this).val();
|
||||||
var parentFormId = $(this).closest("form").attr("id");
|
var parentFormId = $(this).closest("form").attr("id");
|
||||||
|
Loading…
Reference in New Issue
Block a user