This commit is contained in:
Vanessa 2023-12-09 23:33:06 +08:00
parent 801f665c90
commit b6a4566670
11 changed files with 26 additions and 26 deletions

View file

@ -138,7 +138,7 @@ export const initWindowEvent = (app: App) => {
zoomIn, zoomIn,
}); });
window.siyuan.menus.menu.remove(); window.siyuan.menus.menu.remove();
}) });
} }
event.stopImmediatePropagation(); event.stopImmediatePropagation();
event.preventDefault(); event.preventDefault();

View file

@ -101,7 +101,7 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
if (dialog) { if (dialog) {
dialog.destroy({focus: "false"}); dialog.destroy({focus: "false"});
} }
}) });
return true; return true;
} }
const id = currentList.getAttribute("data-node-id"); const id = currentList.getAttribute("data-node-id");
@ -206,7 +206,7 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
if (dialog) { if (dialog) {
dialog.destroy({focus: "false"}); dialog.destroy({focus: "false"});
} }
}) });
} }
} else { } else {
/// #if !BROWSER /// #if !BROWSER

View file

@ -33,9 +33,9 @@ export const checkFold = (id: string, cb: (zoomIn: boolean, action: string[]) =>
return; return;
} }
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => { fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
cb(foldResponse.data, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]) cb(foldResponse.data, foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
}); });
} };
export const openFileById = async (options: { export const openFileById = async (options: {
app: App, app: App,

View file

@ -84,7 +84,7 @@ export class Bookmark extends Model {
return; return;
} }
} }
const id = element.getAttribute("data-node-id") const id = element.getAttribute("data-node-id");
checkFold(id, (zoomIn, action: string[]) => { checkFold(id, (zoomIn, action: string[]) => {
openFileById({ openFileById({
app, app,
@ -98,7 +98,7 @@ export class Bookmark extends Model {
openBookmarkMenu(element, event, this); openBookmarkMenu(element, event, this);
}, },
ctrlClick: (element: HTMLElement) => { ctrlClick: (element: HTMLElement) => {
const id = element.getAttribute("data-node-id") const id = element.getAttribute("data-node-id");
checkFold(id, (zoomIn) => { checkFold(id, (zoomIn) => {
openFileById({ openFileById({
app, app,
@ -107,10 +107,10 @@ export class Bookmark extends Model {
action: zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL], action: zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL],
zoomIn zoomIn
}); });
}) });
}, },
altClick: (element: HTMLElement,) => { altClick: (element: HTMLElement,) => {
const id = element.getAttribute("data-node-id") const id = element.getAttribute("data-node-id");
checkFold(id, (zoomIn, action: string[]) => { checkFold(id, (zoomIn, action: string[]) => {
openFileById({ openFileById({
app, app,
@ -119,10 +119,10 @@ export class Bookmark extends Model {
action, action,
zoomIn zoomIn
}); });
}) });
}, },
shiftClick: (element: HTMLElement) => { shiftClick: (element: HTMLElement) => {
const id = element.getAttribute("data-node-id") const id = element.getAttribute("data-node-id");
checkFold(id, (zoomIn, action: string[]) => { checkFold(id, (zoomIn, action: string[]) => {
openFileById({ openFileById({
app, app,
@ -131,7 +131,7 @@ export class Bookmark extends Model {
action, action,
zoomIn zoomIn
}); });
}) });
}, },
blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>', blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',
topExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>', topExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>',

View file

@ -660,7 +660,7 @@ export class Graph extends Model {
action, action,
zoomIn zoomIn
}); });
}) });
} else if (window.siyuan.altIsPressed) { } else if (window.siyuan.altIsPressed) {
checkFold(node.id, (zoomIn, action: string[]) => { checkFold(node.id, (zoomIn, action: string[]) => {
openFileById({ openFileById({
@ -670,7 +670,7 @@ export class Graph extends Model {
action, action,
zoomIn zoomIn
}); });
}) });
} else if (window.siyuan.ctrlIsPressed) { } else if (window.siyuan.ctrlIsPressed) {
window.siyuan.blockPanels.push(new BlockPanel({ window.siyuan.blockPanels.push(new BlockPanel({
app: this.app, app: this.app,
@ -687,7 +687,7 @@ export class Graph extends Model {
action, action,
zoomIn zoomIn
}); });
}) });
} }
}); });
}, 1000); }, 1000);

View file

@ -129,7 +129,7 @@ export class Outline extends Model {
id, id,
action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML], action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML],
}); });
}) });
} }
}, },
ctrlClick(element: HTMLElement) { ctrlClick(element: HTMLElement) {

View file

@ -49,7 +49,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
action, action,
zoomIn zoomIn
}); });
}) });
} }
} }
}, { }, {
@ -68,7 +68,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
action, action,
zoomIn zoomIn
}); });
}) });
} }
} }
}]; }];
@ -93,7 +93,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
zoomIn, zoomIn,
removeCurrentTab: false removeCurrentTab: false
}); });
}) });
} }
} }
}); });

View file

@ -5,7 +5,7 @@ import {hasClosestByClassName} from "../../protyle/util/hasClosest";
import {openMobileFileById} from "../editor"; import {openMobileFileById} from "../editor";
import {openBookmarkMenu} from "../../menus/bookmark"; import {openBookmarkMenu} from "../../menus/bookmark";
import {App} from "../../index"; import {App} from "../../index";
import {checkFold, openFileById} from "../../editor/util"; import {checkFold} from "../../editor/util";
export class MobileBookmarks { export class MobileBookmarks {
public element: HTMLElement; public element: HTMLElement;
@ -39,7 +39,7 @@ export class MobileBookmarks {
return; return;
} }
} }
checkFold(id, (zoomIn, action) => { checkFold(id, (zoomIn) => {
openMobileFileById(app, id, zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]); openMobileFileById(app, id, zoomIn ? [Constants.CB_GET_HL, Constants.CB_GET_ALL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
}); });
}, },

View file

@ -1793,7 +1793,7 @@ export class WYSIWYG {
}); });
} }
/// #endif /// #endif
}) });
/// #if !MOBILE /// #if !MOBILE
if (protyle.model) { if (protyle.model) {
// 打开双链需记录到后退中 https://github.com/siyuan-note/insider/issues/801 // 打开双链需记录到后退中 https://github.com/siyuan-note/insider/issues/801
@ -1941,7 +1941,7 @@ export class WYSIWYG {
})); }));
} }
/// #endif /// #endif
}) });
event.stopPropagation(); event.stopPropagation();
return; return;
} }

View file

@ -1532,7 +1532,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
action, action,
zoomIn zoomIn
}); });
}) });
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
return true; return true;

View file

@ -876,7 +876,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
if (closeCB) { if (closeCB) {
closeCB(); closeCB();
} }
}) });
} else if (!target.classList.contains("b3-list-item--focus")) { } else if (!target.classList.contains("b3-list-item--focus")) {
searchPanelElement.querySelector(".b3-list-item--focus").classList.remove("b3-list-item--focus"); searchPanelElement.querySelector(".b3-list-item--focus").classList.remove("b3-list-item--focus");
target.classList.add("b3-list-item--focus"); target.classList.add("b3-list-item--focus");
@ -915,7 +915,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
if (closeCB) { if (closeCB) {
closeCB(); closeCB();
} }
}) });
} }
} }
window.siyuan.menus.menu.remove(); window.siyuan.menus.menu.remove();