mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
67743b50ba
commit
2b06134a5a
4 changed files with 10 additions and 9 deletions
|
|
@ -9,7 +9,7 @@ import {webViewerLoad} from "./pdf/viewer";
|
||||||
import {webViewerPageNumberChanged} from "./pdf/app";
|
import {webViewerPageNumberChanged} from "./pdf/app";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {fetchPost} from "../util/fetch";
|
import {fetchPost} from "../util/fetch";
|
||||||
import { setStorageVal } from "../protyle/util/compatibility";
|
import {setStorageVal} from "../protyle/util/compatibility";
|
||||||
|
|
||||||
export class Asset extends Model {
|
export class Asset extends Model {
|
||||||
public path: string;
|
public path: string;
|
||||||
|
|
@ -57,7 +57,7 @@ export class Asset extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
public goToPage(pdfId: string | number) {
|
public goToPage(pdfId: string | number) {
|
||||||
if (typeof pdfId === "undefined") {
|
if (typeof pdfId === "undefined" || pdfId === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.pdfId = pdfId;
|
this.pdfId = pdfId;
|
||||||
|
|
@ -68,7 +68,9 @@ export class Asset extends Model {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (typeof pdfId === "number" && !isNaN(pdfId)) {
|
||||||
webViewerPageNumberChanged({value: this.pdfId, pdfInstance: this.pdfObject});
|
webViewerPageNumberChanged({value: this.pdfId, pdfInstance: this.pdfObject});
|
||||||
|
}
|
||||||
/// #endif
|
/// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -299,12 +299,12 @@ export const JSONToLayout = (isStart: boolean) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// https://github.com/siyuan-note/siyuan/pull/7086
|
// https://github.com/siyuan-note/siyuan/pull/7086
|
||||||
const openId = getSearch("id", window.location.href);
|
const openId = getSearch("id");
|
||||||
if (openId !== null) {
|
if (openId !== null) {
|
||||||
openFileById({
|
openFileById({
|
||||||
id: openId,
|
id: openId,
|
||||||
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT],
|
||||||
zoomIn: getSearch("focus", window.location.href) === "1"
|
zoomIn: getSearch("focus") === "1"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -128,10 +128,10 @@ export const initFramework = () => {
|
||||||
});
|
});
|
||||||
initEditorName();
|
initEditorName();
|
||||||
if (getOpenNotebookCount() > 0) {
|
if (getOpenNotebookCount() > 0) {
|
||||||
const openId = getSearch("id", window.location.href);
|
const openId = getSearch("id");
|
||||||
if (openId !== null) {
|
if (openId !== null) {
|
||||||
openMobileFileById(openId,
|
openMobileFileById(openId,
|
||||||
getSearch("focus", window.location.href) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
getSearch("focus") === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
||||||
} else {
|
} else {
|
||||||
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
|
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
|
||||||
fetchPost("/api/block/checkBlockExist", {id: localDoc.id}, existResponse => {
|
fetchPost("/api/block/checkBlockExist", {id: localDoc.id}, existResponse => {
|
||||||
|
|
|
||||||
|
|
@ -1577,8 +1577,7 @@ export class WYSIWYG {
|
||||||
} else if (window.siyuan.shiftIsPressed) {
|
} else if (window.siyuan.shiftIsPressed) {
|
||||||
openBy(linkAddress, "app");
|
openBy(linkAddress, "app");
|
||||||
} else {
|
} else {
|
||||||
const page = getSearch("page", linkAddress);
|
openAsset(linkPathname, parseInt(getSearch("page", linkAddress)), "right");
|
||||||
openAsset(linkPathname, page === null ? undefined : parseInt(page), "right");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue