diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index a13a59417..999a7c9a7 100644 Binary files a/netbox/project-static/dist/netbox.js and b/netbox/project-static/dist/netbox.js differ diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 593f07697..a7f3cb632 100644 Binary files a/netbox/project-static/dist/netbox.js.map and b/netbox/project-static/dist/netbox.js.map differ diff --git a/netbox/project-static/src/htmx.ts b/netbox/project-static/src/htmx.ts index 8d92b60c8..9937cc00f 100644 --- a/netbox/project-static/src/htmx.ts +++ b/netbox/project-static/src/htmx.ts @@ -1,4 +1,3 @@ -import { getElements, isTruthy } from './util'; import { initButtons } from './buttons'; import { initSelects } from './select'; import { initObjectSelector } from './objectSelector'; @@ -15,16 +14,5 @@ function initDepedencies(): void { * elements. */ export function initHtmx(): void { - for (const element of getElements('[hx-target]')) { - const targetSelector = element.getAttribute('hx-target'); - if (isTruthy(targetSelector)) { - for (const target of getElements(targetSelector)) { - target.addEventListener('htmx:afterSettle', initDepedencies); - } - } - } - - for (const element of getElements('[hx-trigger=load]')) { - element.addEventListener('htmx:afterSettle', initDepedencies); - } + document.addEventListener('htmx:afterSettle', initDepedencies); } diff --git a/netbox/project-static/src/select/dynamic.ts b/netbox/project-static/src/select/dynamic.ts index 20912140b..710b665c2 100644 --- a/netbox/project-static/src/select/dynamic.ts +++ b/netbox/project-static/src/select/dynamic.ts @@ -42,7 +42,7 @@ function renderItem(data: TomOption, escape: typeof escape_html) { // Initialize elements with statically-defined options export function initStaticSelects(): void { for (const select of getElements( - 'select:not(.api-select):not(.color-select)', + 'select:not(.tomselected):not(.api-select):not(.color-select)', )) { new TomSelect(select, { ...config, @@ -23,7 +23,7 @@ export function initColorSelects(): void { )}"> ${escape(item.text)}`; } - for (const select of getElements('select.color-select')) { + for (const select of getElements('select:not(.tomselected).color-select')) { new TomSelect(select, { ...config, render: {