adds bootstrap initialization for hx-trigger=load #12627

This commit is contained in:
Abhimanyu Saharan 2023-05-26 16:40:10 +05:30
parent da9c5572bf
commit 3ddbe34ea6
3 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,9 +2,10 @@ import { getElements, isTruthy } from './util';
import { initButtons } from './buttons'; import { initButtons } from './buttons';
import { initSelect } from './select'; import { initSelect } from './select';
import { initObjectSelector } from './objectSelector'; import { initObjectSelector } from './objectSelector';
import { initBootstrap } from './bs';
function initDepedencies(): void { function initDepedencies(): void {
for (const init of [initButtons, initSelect, initObjectSelector]) { for (const init of [initButtons, initSelect, initObjectSelector, initBootstrap]) {
init(); init();
} }
} }
@ -22,4 +23,8 @@ export function initHtmx(): void {
} }
} }
} }
for (const element of getElements('[hx-trigger=load]')) {
element.addEventListener('htmx:afterSettle', initDepedencies);
}
} }