mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00: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) => {
|
export const addLoading = (protyle: IProtyle) => {
|
||||||
|
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>');
|
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) => {
|
export const removeLoading = (protyle: IProtyle) => {
|
||||||
|
protyle.element.setAttribute("data-loading", "finished");
|
||||||
const loadingElement = protyle.element.querySelector(".wysiwygLoading");
|
const loadingElement = protyle.element.querySelector(".wysiwygLoading");
|
||||||
if (loadingElement) {
|
if (loadingElement) {
|
||||||
loadingElement.remove();
|
loadingElement.remove();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue