mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
6f65247cc8
commit
ed30175daf
1 changed files with 7 additions and 1 deletions
|
|
@ -73,10 +73,16 @@ export const initUI = (protyle: IProtyle) => {
|
|||
};
|
||||
|
||||
export const addLoading = (protyle: IProtyle) => {
|
||||
protyle.element.insertAdjacentHTML("beforeend", '<div style="background-color: var(--b3-theme-background)" class="fn__loading wysiwygLoading"><img width="48px" src="/stage/loading-pure.svg"></div>');
|
||||
protyle.element.removeAttribute("data-loading");
|
||||
setTimeout(() => {
|
||||
if (protyle.element.getAttribute("data-loading") !== "finished") {
|
||||
protyle.element.insertAdjacentHTML("beforeend", '<div style="background-color: var(--b3-theme-background)" class="fn__loading wysiwygLoading"><img width="48px" src="/stage/loading-pure.svg"></div>');
|
||||
}
|
||||
}, Constants.TIMEOUT_BLOCKLOAD);
|
||||
};
|
||||
|
||||
export const removeLoading = (protyle: IProtyle) => {
|
||||
protyle.element.setAttribute("data-loading", "finished");
|
||||
const loadingElement = protyle.element.querySelector(".wysiwygLoading");
|
||||
if (loadingElement) {
|
||||
loadingElement.remove();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue