This commit is contained in:
parent
caa2f1311f
commit
9f62738fa4
9 changed files with 14 additions and 14 deletions
|
@ -44,14 +44,14 @@ export class MobileBacklinks {
|
|||
element: this.element.querySelector(".backlinkList") as HTMLElement,
|
||||
data: null,
|
||||
click(element: HTMLElement) {
|
||||
openMobileFileById(app, element.getAttribute("data-node-id"), [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
|
||||
openMobileFileById(app, element.getAttribute("data-node-id"), [Constants.CB_GET_CONTEXT]);
|
||||
}
|
||||
});
|
||||
this.mTree = new Tree({
|
||||
element: this.element.querySelector(".backlinkMList") as HTMLElement,
|
||||
data: null,
|
||||
click: (element) => {
|
||||
openMobileFileById(app, element.getAttribute("data-node-id"), [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT]);
|
||||
openMobileFileById(app, element.getAttribute("data-node-id"), [Constants.CB_GET_CONTEXT]);
|
||||
},
|
||||
});
|
||||
this.element.addEventListener("click", (event) => {
|
||||
|
|
|
@ -223,7 +223,7 @@ export class MobileFiles extends Model {
|
|||
} else if (target.tagName === "LI") {
|
||||
this.setCurrent(target);
|
||||
if (target.getAttribute("data-type") === "navigation-file") {
|
||||
openMobileFileById(app, target.getAttribute("data-node-id"), [Constants.CB_GET_SCROLL, Constants.CB_GET_HL]);
|
||||
openMobileFileById(app, target.getAttribute("data-node-id"), [Constants.CB_GET_SCROLL]);
|
||||
} else if (target.getAttribute("data-type") === "navigation-root") {
|
||||
const ulElement = hasTopClosestByTag(target, "UL");
|
||||
if (ulElement) {
|
||||
|
|
|
@ -37,7 +37,7 @@ export class MobileOutline {
|
|||
document.getElementById(id)?.scrollIntoView();
|
||||
} else {
|
||||
checkFold(id, (zoomIn) => {
|
||||
openMobileFileById(app, id, zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_HL, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]);
|
||||
openMobileFileById(app, id, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML]);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,7 +162,7 @@ window.hideKeyboardToolbar = hideKeyboardToolbar;
|
|||
window.openFileByURL = (openURL) => {
|
||||
if (openURL && isSYProtocol(openURL)) {
|
||||
openMobileFileById(siyuanApp, getIdFromSYProtocol(openURL),
|
||||
getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -24,7 +24,7 @@ ${unicode2Emoji(item.icon || Constants.SIYUAN_IMAGE_FILE, "b3-list-item__graphic
|
|||
element.firstElementChild.addEventListener("click", (event) => {
|
||||
const liElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item");
|
||||
if (liElement) {
|
||||
openMobileFileById(app, liElement.dataset.nodeId, [Constants.CB_GET_SCROLL, Constants.CB_GET_HL]);
|
||||
openMobileFileById(app, liElement.dataset.nodeId, [Constants.CB_GET_SCROLL]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -591,7 +591,7 @@ const initSearchEvent = (app: App, element: Element, config: Config.IUILayoutTab
|
|||
preventScroll(window.siyuan.mobile.editor.protyle);
|
||||
}
|
||||
checkFold(id, (zoomIn) => {
|
||||
openMobileFileById(app, id, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
openMobileFileById(app, id, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
});
|
||||
closePanel();
|
||||
} else {
|
||||
|
|
|
@ -174,7 +174,7 @@ export const initFramework = (app: App, isStart: boolean) => {
|
|||
const idZoomIn = getIdZoomInByPath();
|
||||
if (idZoomIn.id) {
|
||||
openMobileFileById(app, idZoomIn.id,
|
||||
idZoomIn.isZoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
idZoomIn.isZoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.config.fileTree.closeTabsOnStart && isStart) {
|
||||
|
@ -184,12 +184,12 @@ export const initFramework = (app: App, isStart: boolean) => {
|
|||
const localDoc = window.siyuan.storage[Constants.LOCAL_DOCINFO];
|
||||
fetchPost("/api/block/checkBlockExist", {id: localDoc.id}, existResponse => {
|
||||
if (existResponse.data) {
|
||||
openMobileFileById(app, localDoc.id, [Constants.CB_GET_SCROLL, Constants.CB_GET_HL]);
|
||||
openMobileFileById(app, localDoc.id, [Constants.CB_GET_SCROLL]);
|
||||
} else {
|
||||
fetchPost("/api/block/getRecentUpdatedBlocks", {}, (response) => {
|
||||
if (response.data.length !== 0) {
|
||||
checkFold(response.data[0].id, (zoomIn) => {
|
||||
openMobileFileById(app, response.data[0].id, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
openMobileFileById(app, response.data[0].id, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
});
|
||||
} else {
|
||||
setEmpty(app);
|
||||
|
|
|
@ -45,7 +45,7 @@ export const onMessage = (app: App, data: IWebSocketData) => {
|
|||
}
|
||||
break;
|
||||
case "openFileById":
|
||||
openMobileFileById(app, data.data.id, [Constants.CB_GET_HL]);
|
||||
openMobileFileById(app, data.data.id);
|
||||
break;
|
||||
case"txerr":
|
||||
transactionError();
|
||||
|
|
|
@ -2142,7 +2142,7 @@ export class WYSIWYG {
|
|||
action.push(Constants.CB_GET_HL);
|
||||
}
|
||||
/// #if MOBILE
|
||||
openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
/// #else
|
||||
|
@ -2207,7 +2207,7 @@ export class WYSIWYG {
|
|||
excludeIDs: [blockElement.getAttribute("data-node-id")]
|
||||
}, (response) => {
|
||||
checkFold(response.data[0], (zoomIn) => {
|
||||
openMobileFileById(protyle.app, response.data[0], zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
openMobileFileById(protyle.app, response.data[0], zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
});
|
||||
|
@ -2278,7 +2278,7 @@ export class WYSIWYG {
|
|||
const embedId = embedItemElement.getAttribute("data-id");
|
||||
checkFold(embedId, (zoomIn, action) => {
|
||||
/// #if MOBILE
|
||||
openMobileFileById(protyle.app, embedId, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
openMobileFileById(protyle.app, embedId, zoomIn ? [Constants.CB_GET_ALL] : [Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||
activeBlur();
|
||||
hideKeyboardToolbar();
|
||||
/// #else
|
||||
|
|
Loading…
Add table
Reference in a new issue