🚨
This commit is contained in:
parent
801f665c90
commit
b6a4566670
11 changed files with 26 additions and 26 deletions
|
@ -138,7 +138,7 @@ export const initWindowEvent = (app: App) => {
|
|||
zoomIn,
|
||||
});
|
||||
window.siyuan.menus.menu.remove();
|
||||
})
|
||||
});
|
||||
}
|
||||
event.stopImmediatePropagation();
|
||||
event.preventDefault();
|
||||
|
|
|
@ -101,7 +101,7 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
|||
if (dialog) {
|
||||
dialog.destroy({focus: "false"});
|
||||
}
|
||||
})
|
||||
});
|
||||
return true;
|
||||
}
|
||||
const id = currentList.getAttribute("data-node-id");
|
||||
|
@ -206,7 +206,7 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
|
|||
if (dialog) {
|
||||
dialog.destroy({focus: "false"});
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
} else {
|
||||
/// #if !BROWSER
|
||||
|
|
|
@ -33,9 +33,9 @@ export const checkFold = (id: string, cb: (zoomIn: boolean, action: string[]) =>
|
|||
return;
|
||||
}
|
||||
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: {
|
||||
app: App,
|
||||
|
|
|
@ -84,7 +84,7 @@ export class Bookmark extends Model {
|
|||
return;
|
||||
}
|
||||
}
|
||||
const id = element.getAttribute("data-node-id")
|
||||
const id = element.getAttribute("data-node-id");
|
||||
checkFold(id, (zoomIn, action: string[]) => {
|
||||
openFileById({
|
||||
app,
|
||||
|
@ -98,7 +98,7 @@ export class Bookmark extends Model {
|
|||
openBookmarkMenu(element, event, this);
|
||||
},
|
||||
ctrlClick: (element: HTMLElement) => {
|
||||
const id = element.getAttribute("data-node-id")
|
||||
const id = element.getAttribute("data-node-id");
|
||||
checkFold(id, (zoomIn) => {
|
||||
openFileById({
|
||||
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],
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
},
|
||||
altClick: (element: HTMLElement,) => {
|
||||
const id = element.getAttribute("data-node-id")
|
||||
const id = element.getAttribute("data-node-id");
|
||||
checkFold(id, (zoomIn, action: string[]) => {
|
||||
openFileById({
|
||||
app,
|
||||
|
@ -119,10 +119,10 @@ export class Bookmark extends Model {
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
},
|
||||
shiftClick: (element: HTMLElement) => {
|
||||
const id = element.getAttribute("data-node-id")
|
||||
const id = element.getAttribute("data-node-id");
|
||||
checkFold(id, (zoomIn, action: string[]) => {
|
||||
openFileById({
|
||||
app,
|
||||
|
@ -131,7 +131,7 @@ export class Bookmark extends Model {
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
},
|
||||
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>',
|
||||
|
|
|
@ -660,7 +660,7 @@ export class Graph extends Model {
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
} else if (window.siyuan.altIsPressed) {
|
||||
checkFold(node.id, (zoomIn, action: string[]) => {
|
||||
openFileById({
|
||||
|
@ -670,7 +670,7 @@ export class Graph extends Model {
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
} else if (window.siyuan.ctrlIsPressed) {
|
||||
window.siyuan.blockPanels.push(new BlockPanel({
|
||||
app: this.app,
|
||||
|
@ -687,7 +687,7 @@ export class Graph extends Model {
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
|
|
|
@ -129,7 +129,7 @@ export class Outline extends Model {
|
|||
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],
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
ctrlClick(element: HTMLElement) {
|
||||
|
|
|
@ -49,7 +49,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
|
@ -68,7 +68,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
@ -93,7 +93,7 @@ export const openEditorTab = (app: App, id: string, notebookId?: string, pathStr
|
|||
zoomIn,
|
||||
removeCurrentTab: false
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@ import {hasClosestByClassName} from "../../protyle/util/hasClosest";
|
|||
import {openMobileFileById} from "../editor";
|
||||
import {openBookmarkMenu} from "../../menus/bookmark";
|
||||
import {App} from "../../index";
|
||||
import {checkFold, openFileById} from "../../editor/util";
|
||||
import {checkFold} from "../../editor/util";
|
||||
|
||||
export class MobileBookmarks {
|
||||
public element: HTMLElement;
|
||||
|
@ -39,7 +39,7 @@ export class MobileBookmarks {
|
|||
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]);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -1793,7 +1793,7 @@ export class WYSIWYG {
|
|||
});
|
||||
}
|
||||
/// #endif
|
||||
})
|
||||
});
|
||||
/// #if !MOBILE
|
||||
if (protyle.model) {
|
||||
// 打开双链需记录到后退中 https://github.com/siyuan-note/insider/issues/801
|
||||
|
@ -1941,7 +1941,7 @@ export class WYSIWYG {
|
|||
}));
|
||||
}
|
||||
/// #endif
|
||||
})
|
||||
});
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1532,7 +1532,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
action,
|
||||
zoomIn
|
||||
});
|
||||
})
|
||||
});
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return true;
|
||||
|
|
|
@ -876,7 +876,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
if (closeCB) {
|
||||
closeCB();
|
||||
}
|
||||
})
|
||||
});
|
||||
} else if (!target.classList.contains("b3-list-item--focus")) {
|
||||
searchPanelElement.querySelector(".b3-list-item--focus").classList.remove("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) {
|
||||
closeCB();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
window.siyuan.menus.menu.remove();
|
||||
|
|
Loading…
Add table
Reference in a new issue