Merge "Fixes behavior of the 'check-all' checkbox"
This commit is contained in:
commit
3990985aa0
@ -115,19 +115,6 @@ horizon.datatables = {
|
|||||||
$(this).find(".table_actions button.btn-danger").addClass("disabled");
|
$(this).find(".table_actions button.btn-danger").addClass("disabled");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("div.table_wrapper, div.modal_wrapper").on("click", ':checkbox', function (evt) {
|
|
||||||
var $form = $(this).closest("form");
|
|
||||||
var any_checked = $form.find("tbody :checkbox").is(":checked");
|
|
||||||
|
|
||||||
// Enable the button if any checkbox is checked,
|
|
||||||
// Disable if all checkbox is cleared
|
|
||||||
if(any_checked) {
|
|
||||||
$form.find(".table_actions button.btn-danger").removeClass("disabled");
|
|
||||||
}else {
|
|
||||||
$form.find(".table_actions button.btn-danger").addClass("disabled");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -223,6 +210,18 @@ horizon.addInitFunction(function() {
|
|||||||
checkboxes.prop('checked', is_checked);
|
checkboxes.prop('checked', is_checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("div.table_wrapper, div.modal_wrapper").on("click", ':checkbox', function (evt) {
|
||||||
|
var $form = $(this).closest("form");
|
||||||
|
var any_checked = $form.find("tbody :checkbox").is(":checked");
|
||||||
|
// Enable the button if any checkbox is checked,
|
||||||
|
// Disable if all checkbox is cleared
|
||||||
|
if(any_checked) {
|
||||||
|
$form.find(".table_actions button.btn-danger").removeClass("disabled");
|
||||||
|
}else {
|
||||||
|
$form.find(".table_actions button.btn-danger").addClass("disabled");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
horizon.datatables.add_table_checkboxes($('body'));
|
horizon.datatables.add_table_checkboxes($('body'));
|
||||||
horizon.datatables.set_table_sorting($('body'));
|
horizon.datatables.set_table_sorting($('body'));
|
||||||
horizon.datatables.set_table_filter($('body'));
|
horizon.datatables.set_table_filter($('body'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user