This commit is contained in:
Vanessa 2023-02-24 15:26:43 +08:00
parent cdae86d50b
commit 5b30b60bf7
5 changed files with 9 additions and 9 deletions

View file

@ -467,14 +467,14 @@ export class Asset extends Model {
const observer = new MutationObserver(() => { const observer = new MutationObserver(() => {
this.pdfObject = webViewerLoad(this.path.startsWith("file") ? this.path : document.getElementById("baseURL").getAttribute("href") + "/" + this.path, this.pdfObject = webViewerLoad(this.path.startsWith("file") ? this.path : document.getElementById("baseURL").getAttribute("href") + "/" + this.path,
this.element, this.pdfPage, this.pdfId); this.element, this.pdfPage, this.pdfId);
this.element.setAttribute("data-loading", "true") this.element.setAttribute("data-loading", "true");
observer.disconnect(); observer.disconnect();
}); });
observer.observe(this.element, {attributeFilter: ["class"]}); observer.observe(this.element, {attributeFilter: ["class"]});
} else { } else {
this.pdfObject = webViewerLoad(this.path.startsWith("file") ? this.path : document.getElementById("baseURL").getAttribute("href") + "/" + this.path, this.pdfObject = webViewerLoad(this.path.startsWith("file") ? this.path : document.getElementById("baseURL").getAttribute("href") + "/" + this.path,
this.element, this.pdfPage, this.pdfId); this.element, this.pdfPage, this.pdfId);
this.element.setAttribute("data-loading", "true") this.element.setAttribute("data-loading", "true");
} }
}, Constants.TIMEOUT_BLOCKLOAD); }, Constants.TIMEOUT_BLOCKLOAD);
/// #endif /// #endif

View file

@ -132,7 +132,7 @@ export const viewCards = (deckID: string, title: string, cb:(response:IWebSocket
if (!nextElment) { if (!nextElment) {
getArticle(edit, ""); getArticle(edit, "");
listElement.innerHTML = `<div class="b3-list--empty">${window.siyuan.languages.emptyContent}</div>` listElement.innerHTML = `<div class="b3-list--empty">${window.siyuan.languages.emptyContent}</div>`;
} else { } else {
getArticle(edit, nextElment.getAttribute("data-id")); getArticle(edit, nextElment.getAttribute("data-id"));
listElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus"); listElement.querySelector(".b3-list-item--focus")?.classList.remove("b3-list-item--focus");

View file

@ -581,12 +581,12 @@ export const copyTab = (tab: Tab) => {
}; };
export const pdfIsLoading = (element: HTMLElement) => { export const pdfIsLoading = (element: HTMLElement) => {
const isLoading = element.querySelector('.layout-tab-container > [data-loading="true"]') ? true : false const isLoading = element.querySelector('.layout-tab-container > [data-loading="true"]') ? true : false;
if (isLoading) { if (isLoading) {
showMessage(window.siyuan.languages.pdfIsLoading); showMessage(window.siyuan.languages.pdfIsLoading);
} }
return isLoading; return isLoading;
} };
export const getInstanceById = (id: string, layout = window.siyuan.layout.centerLayout) => { export const getInstanceById = (id: string, layout = window.siyuan.layout.centerLayout) => {
const _getInstanceById = (item: Layout | Wnd, id: string) => { const _getInstanceById = (item: Layout | Wnd, id: string) => {

View file

@ -409,8 +409,8 @@ ${window.siyuan.languages.createdAt} ${dayjs(response.data.ial.id.substr(0, 14))
return false; return false;
} }
this.element.setAttribute("data-node-id", protyle.block.rootID); this.element.setAttribute("data-node-id", protyle.block.rootID);
if (response.data.ial['custom-riff-decks']) { if (response.data.ial["custom-riff-decks"]) {
this.element.setAttribute("custom-riff-decks", response.data.ial['custom-riff-decks']); this.element.setAttribute("custom-riff-decks", response.data.ial["custom-riff-decks"]);
} }
protyle.background.render(response.data.ial, protyle.block.rootID); protyle.background.render(response.data.ial, protyle.block.rootID);
protyle.wysiwyg.renderCustom(response.data.ial); protyle.wysiwyg.renderCustom(response.data.ial);

View file

@ -448,8 +448,8 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, focus: b
if (refElement) { if (refElement) {
nodeAttrHTML += refElement.outerHTML; nodeAttrHTML += refElement.outerHTML;
} }
if (data.new['custom-riff-decks']) { if (data.new["custom-riff-decks"]) {
protyle.title.element.setAttribute("custom-riff-decks", data.new['custom-riff-decks']); protyle.title.element.setAttribute("custom-riff-decks", data.new["custom-riff-decks"]);
} else { } else {
protyle.title.element.removeAttribute("custom-riff-decks"); protyle.title.element.removeAttribute("custom-riff-decks");
} }