Merge "Fixes behavior of the 'check-all' checkbox"

This commit is contained in:
Jenkins 2012-07-09 11:55:23 +00:00 committed by Gerrit Code Review
commit 3990985aa0

View File

@ -115,19 +115,6 @@ horizon.datatables = {
$(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);
});
$("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.set_table_sorting($('body'));
horizon.datatables.set_table_filter($('body'));