mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-11-01 00:03:53 +08:00
1 parent
f6f45a2657
commit
8c9a6da41e
1 file changed
+8
-1
@@ -7140,6 +7140,7 @@ async function openDocument(options = {}) {
|
|||||||
renderFontList();
|
renderFontList();
|
||||||
}
|
}
|
||||||
options.keepPreview ? setBusy(true) : setBusy(true, "正在打开文档", 20, STATUS.opening);
|
options.keepPreview ? setBusy(true) : setBusy(true, "正在打开文档", 20, STATUS.opening);
|
||||||
|
let details;
|
||||||
try {
|
try {
|
||||||
if (!options.keepPreview) {
|
if (!options.keepPreview) {
|
||||||
setProgress("正在解析文档", 52);
|
setProgress("正在解析文档", 52);
|
||||||
@@ -7206,6 +7207,12 @@ async function openDocument(options = {}) {
|
|||||||
if (options.keepPreview) {
|
if (options.keepPreview) {
|
||||||
pageView.resetPageLoading();
|
pageView.resetPageLoading();
|
||||||
state.pageCache.clear();
|
state.pageCache.clear();
|
||||||
|
if (state.editing) {
|
||||||
|
const prepared = await callWASM("ofdgoDocumentInfo").catch(err => ({ detailsError: err.message }));
|
||||||
|
if (openSeq !== state.openSeq) return;
|
||||||
|
details = prepared.detailsError ? null : prepared;
|
||||||
|
Object.assign(doc, { detailsPending: false, detailsError: "" }, prepared);
|
||||||
|
}
|
||||||
if (thumbnailPreviews) {
|
if (thumbnailPreviews) {
|
||||||
for (const page of doc.pages) {
|
for (const page of doc.pages) {
|
||||||
const preview = thumbnailPreviews.get(page.id);
|
const preview = thumbnailPreviews.get(page.id);
|
||||||
@@ -7266,7 +7273,7 @@ async function openDocument(options = {}) {
|
|||||||
canvasEditor.focus();
|
canvasEditor.focus();
|
||||||
}
|
}
|
||||||
pageView.queueNearbyPages(pageIndex, openSeq);
|
pageView.queueNearbyPages(pageIndex, openSeq);
|
||||||
loadDocumentDetails(openSeq);
|
loadDocumentDetails(openSeq, details);
|
||||||
if (page && options.activateActions) {
|
if (page && options.activateActions) {
|
||||||
state.openActionEnabled = true;
|
state.openActionEnabled = true;
|
||||||
state.openActionDocument = !state.editing;
|
state.openActionDocument = !state.editing;
|
||||||
|
|||||||
Reference in new issue
Block a user