This commit is contained in:
Vanessa 2022-11-12 00:55:13 +08:00
parent 85d2faa158
commit 5f09312ae1
3 changed files with 18 additions and 18 deletions

View file

@ -92,14 +92,14 @@ const renderProvider = (provider: number) => {
};
const bindProviderEvent = () => {
const reposDataElement = repos.element.querySelector("#reposData")
const loadingElement = repos.element.querySelector("#reposLoading")
const reposDataElement = repos.element.querySelector("#reposData");
const loadingElement = repos.element.querySelector("#reposLoading");
if (window.siyuan.config.sync.provider === 0) {
if (needSubscribe("")) {
loadingElement.classList.add("fn__none");
let nextElement = reposDataElement
let nextElement = reposDataElement;
while (nextElement) {
nextElement.classList.add("fn__none")
nextElement.classList.add("fn__none");
nextElement = nextElement.nextElementSibling;
}
return;
@ -133,16 +133,16 @@ const bindProviderEvent = () => {
</div>`;
}
});
reposDataElement.classList.remove("fn__none")
reposDataElement.classList.remove("fn__none");
return;
}
loadingElement.classList.add("fn__none");
let nextElement = reposDataElement.nextElementSibling
let nextElement = reposDataElement.nextElementSibling;
while (nextElement) {
nextElement.classList.remove("fn__none")
nextElement.classList.remove("fn__none");
nextElement = nextElement.nextElementSibling;
}
reposDataElement.classList.add("fn__none")
reposDataElement.classList.add("fn__none");
const providerPanelElement = repos.element.querySelector("#syncProviderPanel");
providerPanelElement.querySelectorAll(".b3-text-field").forEach(item => {
item.addEventListener("blur", () => {
@ -319,7 +319,7 @@ ${syncModeHTML}
}
repos.element.querySelector("#syncProviderPanel").innerHTML = renderProvider(window.siyuan.config.sync.provider);
bindProviderEvent();
syncConfigElement.innerHTML = ""
syncConfigElement.innerHTML = "";
});
});
const loadingElement = repos.element.querySelector("#reposLoading") as HTMLElement;

View file

@ -104,8 +104,8 @@ export class Gutter {
}
}
});
const doOperations: IOperation[] = []
const undoOperations: IOperation[] = []
const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = [];
Array.from(foldElement.children).forEach((ulElement) => {
if (ulElement.classList.contains("list")) {
Array.from(ulElement.children).forEach((listItemElement) => {
@ -120,12 +120,12 @@ export class Gutter {
action: "setAttrs",
id: listId,
data: JSON.stringify({fold: hasFold ? "0" : "1"})
})
});
undoOperations.push({
action: "setAttrs",
id: listId,
data: JSON.stringify({fold: hasFold ? "1" : "0"})
})
});
}
});
}
@ -169,8 +169,8 @@ export class Gutter {
}
}
});
const doOperations: IOperation[] = []
const undoOperations: IOperation[] = []
const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = [];
Array.from(foldElement.parentElement.children).find((listItemElement) => {
if (listItemElement.classList.contains("li")) {
if (hasFold) {
@ -183,12 +183,12 @@ export class Gutter {
action: "setAttrs",
id: listId,
data: JSON.stringify({fold: hasFold ? "0" : "1"})
})
});
undoOperations.push({
action: "setAttrs",
id: listId,
data: JSON.stringify({fold: hasFold ? "1" : "0"})
})
});
}
});
transaction(protyle, doOperations, undoOperations);

View file

@ -124,7 +124,7 @@ const promiseTransaction = () => {
// 仅在 alt+click 箭头折叠时才会触发
protyle.wysiwyg.element.querySelectorAll('[data-type="NodeBlockQueryEmbed"]').forEach((item) => {
if (item.querySelector(`[data-node-id="${doOperations[0].id}"]`)) {
item.removeAttribute("data-render")
item.removeAttribute("data-render");
blockRender(protyle, item);
}
});