mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
chore(ts): get rid of bootstrap related ts-ignores
This commit is contained in:
parent
3c83112240
commit
cf11be7f35
@ -1,4 +1,5 @@
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import { Modal } from "bootstrap";
|
||||||
|
|
||||||
function reloadFrontendApp(reason?: string) {
|
function reloadFrontendApp(reason?: string) {
|
||||||
if (reason) {
|
if (reason) {
|
||||||
@ -244,9 +245,7 @@ function getMimeTypeClass(mime: string) {
|
|||||||
|
|
||||||
function closeActiveDialog() {
|
function closeActiveDialog() {
|
||||||
if (glob.activeDialog) {
|
if (glob.activeDialog) {
|
||||||
// TODO: Fix once we use proper ES imports.
|
Modal.getOrCreateInstance(glob.activeDialog[0]).hide();
|
||||||
//@ts-ignore
|
|
||||||
bootstrap.Modal.getOrCreateInstance(glob.activeDialog[0]).hide();
|
|
||||||
glob.activeDialog = null;
|
glob.activeDialog = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,9 +287,7 @@ async function openDialog($dialog: JQuery<HTMLElement>, closeActDialog = true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveFocusedElement();
|
saveFocusedElement();
|
||||||
// TODO: Fix once we use proper ES imports.
|
Modal.getOrCreateInstance($dialog[0]).show();
|
||||||
//@ts-ignore
|
|
||||||
bootstrap.Modal.getOrCreateInstance($dialog[0]).show();
|
|
||||||
|
|
||||||
$dialog.on("hidden.bs.modal", () => {
|
$dialog.on("hidden.bs.modal", () => {
|
||||||
const $autocompleteEl = $(".aa-input");
|
const $autocompleteEl = $(".aa-input");
|
||||||
|
@ -3,6 +3,7 @@ import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
|||||||
import { t } from "../services/i18n.js";
|
import { t } from "../services/i18n.js";
|
||||||
import type FNote from "../entities/fnote.js";
|
import type FNote from "../entities/fnote.js";
|
||||||
import type { EventData } from "../components/app_context.js";
|
import type { EventData } from "../components/app_context.js";
|
||||||
|
import { Dropdown } from "bootstrap";
|
||||||
|
|
||||||
type Editability = "auto" | "readOnly" | "autoReadOnlyDisabled";
|
type Editability = "auto" | "readOnly" | "autoReadOnlyDisabled";
|
||||||
|
|
||||||
@ -65,9 +66,7 @@ export default class EditabilitySelectWidget extends NoteContextAwareWidget {
|
|||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
|
|
||||||
// TODO: Remove once bootstrap is added to webpack.
|
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0]);
|
||||||
//@ts-ignore
|
|
||||||
this.dropdown = bootstrap.Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']"));
|
|
||||||
|
|
||||||
this.$editabilityActiveDesc = this.$widget.find(".editability-active-desc");
|
this.$editabilityActiveDesc = this.$widget.find(".editability-active-desc");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user