mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
Fixes #13446: Don't disable bulk edit/delete buttons after deselecting "select all" checkbox
This commit is contained in:
parent
72e1e8fab1
commit
dc7411e4c5
@ -18,6 +18,7 @@
|
||||
* [#13343](https://github.com/netbox-community/netbox/issues/13343) - Fix filtering of circuits under provider network view
|
||||
* [#13369](https://github.com/netbox-community/netbox/issues/13369) - Fix job termination status for failed reports
|
||||
* [#13414](https://github.com/netbox-community/netbox/issues/13414) - Fix support for "hide-if-unset" custom fields on bulk import forms
|
||||
* [#13446](https://github.com/netbox-community/netbox/issues/13446) - Don't disable bulk edit/delete buttons after deselecting "select all" checkbox
|
||||
|
||||
---
|
||||
|
||||
|
BIN
netbox/project-static/dist/netbox.js
vendored
BIN
netbox/project-static/dist/netbox.js
vendored
Binary file not shown.
BIN
netbox/project-static/dist/netbox.js.map
vendored
BIN
netbox/project-static/dist/netbox.js.map
vendored
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
import { getElement, getElements, findFirstAdjacent } from '../util';
|
||||
import { getElements, findFirstAdjacent } from '../util';
|
||||
|
||||
/**
|
||||
* If any PK checkbox is checked, uncheck the select all table checkbox and the select all
|
||||
@ -63,29 +63,6 @@ function handleSelectAllToggle(event: Event): void {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronize the select all confirmation checkbox state with the select all confirmation button
|
||||
* disabled state. If the select all confirmation checkbox is checked, the buttons should be
|
||||
* enabled. If not, the buttons should be disabled.
|
||||
*
|
||||
* @param event Change Event
|
||||
*/
|
||||
function handleSelectAll(event: Event): void {
|
||||
const target = event.currentTarget as HTMLInputElement;
|
||||
const selectAllBox = getElement<HTMLDivElement>('select-all-box');
|
||||
if (selectAllBox !== null) {
|
||||
for (const button of selectAllBox.querySelectorAll<HTMLButtonElement>(
|
||||
'button[type="submit"]',
|
||||
)) {
|
||||
if (target.checked) {
|
||||
button.disabled = false;
|
||||
} else {
|
||||
button.disabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize table select all elements.
|
||||
*/
|
||||
@ -98,9 +75,4 @@ export function initSelectAll(): void {
|
||||
for (const element of getElements<HTMLInputElement>('input[type="checkbox"][name="pk"]')) {
|
||||
element.addEventListener('change', handlePkCheck);
|
||||
}
|
||||
const selectAll = getElement<HTMLInputElement>('select-all');
|
||||
|
||||
if (selectAll !== null) {
|
||||
selectAll.addEventListener('change', handleSelectAll);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user