mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	chore(ts): get rid of bootstrap related ts-ignores
This commit is contained in:
		| @@ -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"); | ||||
|   | ||||
| @@ -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"); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user