mirror of
https://github.com/zadam/trilium.git
synced 2025-10-06 13:39:51 +08:00
chore(popup_editor): clean up after closing modal
This commit is contained in:
parent
cab86175ef
commit
ddbe7e9936
2 changed files with 8 additions and 1 deletions
|
@ -3,6 +3,7 @@ import NoteContext from "../../components/note_context.js";
|
|||
import { openDialog } from "../../services/dialog.js";
|
||||
import BasicWidget from "../basic_widget.js";
|
||||
import Container from "../containers/container.js";
|
||||
import TypeWidget from "../type_widgets/type_widget.js";
|
||||
|
||||
const TPL = /*html*/`\
|
||||
<div class="popup-editor-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
||||
|
@ -112,6 +113,13 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
|
|||
|
||||
this.handleEventInChildren("activeContextChanged", { noteContext: this.noteContext });
|
||||
});
|
||||
$dialog.on("hidden.bs.modal", () => {
|
||||
const $typeWidgetEl = $dialog.find(".note-detail-printable");
|
||||
if ($typeWidgetEl.length) {
|
||||
const typeWidget = glob.getComponentByEl($typeWidgetEl[0]) as TypeWidget;
|
||||
typeWidget.cleanup();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
handleEventInChildren<T extends EventNames>(name: T, data: EventData<T>): Promise<unknown[] | unknown> | null {
|
||||
|
|
|
@ -3,7 +3,6 @@ import TypeWidget from "./type_widget.js";
|
|||
import appContext from "../../components/app_context.js";
|
||||
import searchService from "../../services/search.js";
|
||||
import { t } from "../../services/i18n.js";
|
||||
import type FNote from "../../entities/fnote.js";
|
||||
|
||||
const TPL = /*html*/`
|
||||
<div class="note-detail-empty note-detail-printable">
|
||||
|
|
Loading…
Add table
Reference in a new issue