mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 12:09:02 +01:00
feat(popup_editor): create an empty modal with auto-trigger
This commit is contained in:
parent
c9c07f0cb0
commit
55b3bf6036
@ -94,6 +94,7 @@ import ToggleReadOnlyButton from "../widgets/floating_buttons/toggle_read_only_b
|
||||
import PngExportButton from "../widgets/floating_buttons/png_export_button.js";
|
||||
import RefreshButton from "../widgets/floating_buttons/refresh_button.js";
|
||||
import { applyModals } from "./layout_commons.js";
|
||||
import PopupEditorDialog from "../widgets/dialogs/popup_editor.js";
|
||||
|
||||
export default class DesktopLayout {
|
||||
|
||||
@ -257,7 +258,8 @@ export default class DesktopLayout {
|
||||
|
||||
// Desktop-specific dialogs.
|
||||
.child(new PasswordNoteSetDialog())
|
||||
.child(new UploadAttachmentsDialog());
|
||||
.child(new UploadAttachmentsDialog())
|
||||
.child(new PopupEditorDialog());
|
||||
|
||||
applyModals(rootContainer);
|
||||
return rootContainer;
|
||||
|
||||
42
apps/client/src/widgets/dialogs/popup_editor.ts
Normal file
42
apps/client/src/widgets/dialogs/popup_editor.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import { openDialog } from "../../services/dialog.js";
|
||||
import BasicWidget from "../basic_widget.js";
|
||||
|
||||
const TPL = /*html*/`\
|
||||
<div class="popup-editor-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Popup editor</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
Hi
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
export default class PopupEditorDialog extends BasicWidget {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
setTimeout(() => {
|
||||
this.openPopupEditorEvent("7mLWh47uEPEp");
|
||||
}, 750);
|
||||
}
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
}
|
||||
|
||||
async refresh() {
|
||||
|
||||
}
|
||||
|
||||
async openPopupEditorEvent(noteId: string) {
|
||||
await this.refresh();
|
||||
openDialog(this.$widget);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user