fix(client/ts): dropdowns not working after conversion

This commit is contained in:
Elian Doran 2024-12-22 00:10:02 +02:00
parent be0c80249e
commit e88cbd5991
No known key found for this signature in database

View File

@ -1,5 +1,4 @@
import dayjs from "dayjs"; import dayjs from "dayjs";
import { Modal } from "bootstrap";
function reloadFrontendApp(reason?: string) { function reloadFrontendApp(reason?: string) {
if (reason) { if (reason) {
@ -205,6 +204,8 @@ function getMimeTypeClass(mime: string) {
function closeActiveDialog() { function closeActiveDialog() {
if (glob.activeDialog) { if (glob.activeDialog) {
// TODO: Fix once we use proper ES imports.
//@ts-ignore
Modal.getOrCreateInstance(glob.activeDialog[0]).hide(); Modal.getOrCreateInstance(glob.activeDialog[0]).hide();
glob.activeDialog = null; glob.activeDialog = null;
} }
@ -249,6 +250,8 @@ async function openDialog($dialog: JQuery<HTMLElement>, closeActDialog = true) {
} }
saveFocusedElement(); saveFocusedElement();
// TODO: Fix once we use proper ES imports.
//@ts-ignore
Modal.getOrCreateInstance($dialog[0]).show(); Modal.getOrCreateInstance($dialog[0]).show();
$dialog.on('hidden.bs.modal', () => { $dialog.on('hidden.bs.modal', () => {