This commit is contained in:
Vanessa 2022-06-29 09:21:08 +08:00
parent 743b559351
commit cb44439d66
4 changed files with 4 additions and 9 deletions

View file

@ -46,9 +46,6 @@ export class Dialog {
}
public destroy() {
if (this.disableClose) {
return false;
}
this.element.remove();
if (this.destroyCallback) {
this.destroyCallback();
@ -59,7 +56,6 @@ export class Dialog {
return true;
}
});
return true;
}
public bindInput(inputElement: HTMLInputElement, enterEvent?: () => void) {

View file

@ -139,7 +139,6 @@ export const transactionError = (data: { code: number, data: string }) => {
});
});
btnsElement[1].addEventListener("click", () => {
dialog.destroy();
fetchPost("/api/filetree/refreshFiletree", {});
});
};

View file

@ -3,11 +3,10 @@ export const hideElements = (panels: string[], protyle?: IProtyle) => {
if (!protyle) {
if (panels.includes("dialog")) {
for (let i = 0; i < window.siyuan.dialogs.length; i++) {
if (window.siyuan.dialogs[i].destroy()) {
window.siyuan.dialogs[i].destroy()
i--;
}
}
}
return;
}
if (panels.includes("hint")) {

View file

@ -287,7 +287,8 @@ export const globalShortcut = () => {
<ul class="b3-list b3-list--background">${tabHtml}</ul>
</div>
<div class="fn__hr"></div>
</div>`
</div>`,
disableClose: true
});
switchDialog.element.addEventListener(isMac() ? "contextmenu" : "click", (event) => {
event.preventDefault();