mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 17:38:37 -06:00
Fixes #282: De-select "all" checkbox if one or more objects are deselected
This commit is contained in:
parent
1e3a03c463
commit
d3a5b82d93
@ -1,9 +1,15 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
// "Select all" checkbox in a table header
|
// "Select all" checkbox in a table header
|
||||||
$('th input:checkbox').click(function (event) {
|
$('th input:checkbox[name=_all]').click(function (event) {
|
||||||
$(this).parents('table').find('td input:checkbox').prop('checked', $(this).prop('checked'));
|
$(this).parents('table').find('td input:checkbox').prop('checked', $(this).prop('checked'));
|
||||||
});
|
});
|
||||||
|
// Uncheck the "select all" checkbox if an item is unchecked
|
||||||
|
$('input:checkbox[name=pk]').click(function (event) {
|
||||||
|
if (!$(this).attr('checked')) {
|
||||||
|
$(this).parents('table').find('input:checkbox[name=_all]').prop('checked', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Slugify
|
// Slugify
|
||||||
function slugify(s, num_chars) {
|
function slugify(s, num_chars) {
|
||||||
|
Loading…
Reference in New Issue
Block a user