1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Remove unused Javascript

This commit is contained in:
Jeremy Stretch
2024-02-09 16:30:14 -05:00
parent 25723aebe0
commit f41105d5e3
4 changed files with 7 additions and 24 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,15 +0,0 @@
import { isTruthy, getElements } from './util';
/**
* Allow any element to be made "clickable" with the use of the `data-href` attribute.
*/
export function initLinks(): void {
for (const link of getElements('*[data-href]')) {
const href = link.getAttribute('data-href');
if (isTruthy(href)) {
link.addEventListener('click', () => {
window.location.assign(href);
});
}
}
}

View File

@ -12,7 +12,6 @@ import { initInterfaceTable } from './tables';
import { initSideNav } from './sidenav';
import { initDashboard } from './dashboard';
import { initRackElevation } from './racks';
import { initLinks } from './links';
import { initHtmx } from './htmx';
function initDocument(): void {
@ -31,7 +30,6 @@ function initDocument(): void {
initSideNav,
initDashboard,
initRackElevation,
initLinks,
initHtmx,
]) {
init();