fix(popup_editor): block popup not working

This commit is contained in:
Elian Doran 2025-07-10 20:54:50 +03:00
parent f04b75fd36
commit 97ea3ac3fc
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

View File

@ -4,14 +4,14 @@ import type { ConfirmDialogOptions, ConfirmDialogResult, ConfirmWithMessageOptio
import type { PromptDialogOptions } from "../widgets/dialogs/prompt.js"; import type { PromptDialogOptions } from "../widgets/dialogs/prompt.js";
import { focusSavedElement, saveFocusedElement } from "./focus.js"; import { focusSavedElement, saveFocusedElement } from "./focus.js";
export async function openDialog($dialog: JQuery<HTMLElement>, closeActDialog = true) { export async function openDialog($dialog: JQuery<HTMLElement>, closeActDialog = true, config?: Partial<Modal.Options>) {
if (closeActDialog) { if (closeActDialog) {
closeActiveDialog(); closeActiveDialog();
glob.activeDialog = $dialog; glob.activeDialog = $dialog;
} }
saveFocusedElement(); saveFocusedElement();
Modal.getOrCreateInstance($dialog[0]).show(); Modal.getOrCreateInstance($dialog[0], config).show();
$dialog.on("hidden.bs.modal", () => { $dialog.on("hidden.bs.modal", () => {
const $autocompleteEl = $(".aa-input"); const $autocompleteEl = $(".aa-input");

View File

@ -540,6 +540,7 @@ button.btn-sm {
/* Making this narrower because https://github.com/zadam/trilium/issues/502 (problem only in smaller font sizes) */ /* Making this narrower because https://github.com/zadam/trilium/issues/502 (problem only in smaller font sizes) */
min-width: 0; min-width: 0;
padding: 0; padding: 0;
z-index: 1000;
} }
pre:not(.hljs) { pre:not(.hljs) {

View File

@ -96,7 +96,9 @@ export default class PopupEditorDialog extends Container<BasicWidget> {
async openInPopupEvent({ noteIdOrPath }: EventData<"openInPopup">) { async openInPopupEvent({ noteIdOrPath }: EventData<"openInPopup">) {
if (await this.refresh(noteIdOrPath)) { if (await this.refresh(noteIdOrPath)) {
const $dialog = await openDialog(this.$widget); const $dialog = await openDialog(this.$widget, false, {
focus: false
});
$dialog.on("shown.bs.modal", () => { $dialog.on("shown.bs.modal", () => {
// Reduce the z-index of modals so that ckeditor popups are properly shown on top of it. // Reduce the z-index of modals so that ckeditor popups are properly shown on top of it.
// The backdrop instance is not shared so it's OK to make a one-off modification. // The backdrop instance is not shared so it's OK to make a one-off modification.