mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 remove close btn https://github.com/siyuan-note/siyuan/issues/5290
This commit is contained in:
parent
743b559351
commit
cb44439d66
4 changed files with 4 additions and 9 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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", {});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue