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

View file

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

View file

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

View file

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