This commit is contained in:
Vanessa 2022-07-15 09:56:52 +08:00
parent 6e02c3e930
commit 7fb533fa9d
5 changed files with 11 additions and 11 deletions

View file

@ -219,7 +219,7 @@ ${window.siyuan.languages.account8}`;
});
const activationCodeElement = account.element.querySelector("#activationCode");
activationCodeElement.addEventListener("click", () => {
const activationCodeInput = (activationCodeElement.previousElementSibling as HTMLInputElement)
const activationCodeInput = (activationCodeElement.previousElementSibling as HTMLInputElement);
fetchPost("/api/account/checkActivationcode", {data: activationCodeInput.value}, (response) => {
if (0 !== response.code) {
activationCodeInput.value = "";

View file

@ -302,7 +302,7 @@ export const bazaar = {
url = "/api/bazaar/installBazaarWidget";
}
target.parentElement.insertAdjacentHTML("afterend", "<img data-type=\"img-loading\" style=\"position: absolute;top: 0;left: 0;height: 100%;width: 100%;padding: 48px;box-sizing: border-box;\" src=\"/stage/loading-pure.svg\">");
const name = target.parentElement.getAttribute("data-name")
const name = target.parentElement.getAttribute("data-name");
fetchPost(url, {
repoURL: target.parentElement.getAttribute("data-url"),
packageName: name,

View file

@ -279,32 +279,32 @@ export const JSONToLayout = () => {
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
item.parent.parent.removeTab(item.parent.id);
}
})
});
allModels.outline.forEach(item => {
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
item.parent.parent.removeTab(item.parent.id);
}
})
});
allModels.search.forEach(item => {
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
item.parent.parent.removeTab(item.parent.id);
}
})
});
allModels.asset.forEach(item => {
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
item.parent.parent.removeTab(item.parent.id);
}
})
});
allModels.graph.forEach(item => {
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
item.parent.parent.removeTab(item.parent.id);
}
})
});
allModels.backlinks.forEach(item => {
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
item.parent.parent.removeTab(item.parent.id);
}
})
});
}
setTimeout(() => {

View file

@ -185,7 +185,7 @@ const listEnter = (protyle: IProtyle, blockElement: HTMLElement, range: Range) =
};
export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle) => {
const disableElement = isNotEditBlock(blockElement)
const disableElement = isNotEditBlock(blockElement);
if ((!disableElement || blockElement.classList.contains("hr")) && blockElement.classList.contains("protyle-wysiwyg--select")) {
setLastNodeRange(getContenteditableElement(blockElement), range, false);
range.collapse(false);

View file

@ -338,7 +338,7 @@ export const globalShortcut = () => {
let icon = `<svg class="b3-list-item__graphic"><use xlink:href="#${item.icon}"></use></svg>`;
let rootId = "";
if (item.model instanceof Editor) {
rootId = ` data-node-id="${item.model.editor.protyle.block.rootID}"`
rootId = ` data-node-id="${item.model.editor.protyle.block.rootID}"`;
icon = `<span class="b3-list-item__graphic">${unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE)}</span>`;
}
tabHtml += `<li data-id="${item.id}"${rootId} class="b3-list-item${currentId === item.id ? " b3-list-item--focus" : ""}"${currentId === item.id ? ' data-original="true"' : ""}>${icon}<span class="b3-list-item__text">${escapeHtml(item.title)}</span></li>`;
@ -575,7 +575,7 @@ export const globalShortcut = () => {
event.stopPropagation();
let activeTabElement = document.querySelector(".block__icons--active");
if (activeTabElement && activeTabElement.getBoundingClientRect().width > 0) {
let type: TDockType
let type: TDockType;
Array.from(activeTabElement.parentElement.classList).find(item => {
if (item.startsWith("sy__")) {
type = item.replace("sy__", "") as TDockType;