mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(popup_editor): block popup not working
This commit is contained in:
parent
f04b75fd36
commit
97ea3ac3fc
@ -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");
|
||||||
|
@ -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) {
|
||||||
|
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user