mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Update TS styling
This commit is contained in:
parent
1bfb6e6f34
commit
6d5af67da8
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,12 +1,16 @@
|
|||||||
import { getElements } from '../util';
|
import { getElements } from '../util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Conditionally add and remove a class that will float the button group
|
* Conditionally add and remove a class that will float the button group
|
||||||
* based on whether or not items in the list are checked
|
* based on whether or not items in the list are checked
|
||||||
*/
|
*/
|
||||||
function toggleFloat(): void {
|
function toggleFloat(): void {
|
||||||
const checkedCheckboxes = document.querySelector<HTMLInputElement>('input[type="checkbox"][name="pk"]:checked');
|
const checkedCheckboxes = document.querySelector<HTMLInputElement>(
|
||||||
const buttonGroup = document.querySelector<HTMLDivElement>('div.form.form-horizontal div.btn-list');
|
'input[type="checkbox"][name="pk"]:checked',
|
||||||
|
);
|
||||||
|
const buttonGroup = document.querySelector<HTMLDivElement>(
|
||||||
|
'div.form.form-horizontal div.btn-list',
|
||||||
|
);
|
||||||
if (!buttonGroup) {
|
if (!buttonGroup) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -19,19 +23,22 @@ function toggleFloat(): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize floating bulk buttons.
|
* Initialize floating bulk buttons.
|
||||||
*/
|
*/
|
||||||
export function initFloatBulk(): void {
|
export function initFloatBulk(): void {
|
||||||
for (const element of getElements<HTMLInputElement>('input[type="checkbox"][name="pk"]')) {
|
for (const element of getElements<HTMLInputElement>(
|
||||||
element.addEventListener('change', event => {
|
'input[type="checkbox"][name="pk"]',
|
||||||
|
)) {
|
||||||
|
element.addEventListener('change', () => {
|
||||||
toggleFloat();
|
toggleFloat();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Handle the select-all checkbox
|
// Handle the select-all checkbox
|
||||||
for (const element of getElements<HTMLInputElement>('table tr th > input[type="checkbox"].toggle')) {
|
for (const element of getElements<HTMLInputElement>(
|
||||||
element.addEventListener('change', event => {
|
'table tr th > input[type="checkbox"].toggle',
|
||||||
|
)) {
|
||||||
|
element.addEventListener('change', () => {
|
||||||
toggleFloat();
|
toggleFloat();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user