Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(ts): get rid of bootstrap related ts-ignores
Panagiotis Papadopouloscf11be7f35dd
diff --git a/src/public/app/services/utils.ts b/src/public/app/services/utils.tsindex 7accea1fbf..f07f552583 100644--- a/src/public/app/services/utils.ts+++ b/src/public/app/services/utils.ts@@ -1,4 +1,5 @@import dayjs from "dayjs";+import { Modal } from "bootstrap";function reloadFrontendApp(reason?: string) {if (reason) {@@ -244,9 +245,7 @@ function getMimeTypeClass(mime: string) {function closeActiveDialog() {if (glob.activeDialog) {- // TODO: Fix once we use proper ES imports.- //@ts-ignore- bootstrap.Modal.getOrCreateInstance(glob.activeDialog[0]).hide();+ Modal.getOrCreateInstance(glob.activeDialog[0]).hide();glob.activeDialog = null;}}@@ -288,9 +287,7 @@ async function openDialog($dialog: JQuery<HTMLElement>, closeActDialog = true) {}saveFocusedElement();- // TODO: Fix once we use proper ES imports.- //@ts-ignore- bootstrap.Modal.getOrCreateInstance($dialog[0]).show();+ Modal.getOrCreateInstance($dialog[0]).show();$dialog.on("hidden.bs.modal", () => {const $autocompleteEl = $(".aa-input");diff --git a/src/public/app/widgets/editability_select.ts b/src/public/app/widgets/editability_select.tsindex d9a8898cf8..14fe8fdd5c 100644--- a/src/public/app/widgets/editability_select.ts+++ b/src/public/app/widgets/editability_select.ts@@ -3,6 +3,7 @@ import NoteContextAwareWidget from "./note_context_aware_widget.js";import { t } from "../services/i18n.js";import type FNote from "../entities/fnote.js";import type { EventData } from "../components/app_context.js";+import { Dropdown } from "bootstrap";type Editability = "auto" | "readOnly" | "autoReadOnlyDisabled";@@ -65,9 +66,7 @@ export default class EditabilitySelectWidget extends NoteContextAwareWidget {doRender() {this.$widget = $(TPL);- // TODO: Remove once bootstrap is added to webpack.- //@ts-ignore- this.dropdown = bootstrap.Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']"));+ this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0]);this.$editabilityActiveDesc = this.$widget.find(".editability-active-desc");