mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
1 parent
1a25472b43
commit
545b697310
2 files changed
+4
-6
No files matched your search
@@ -2041,11 +2041,7 @@ function handleKeyDown(event) {
|
||||
}
|
||||
if (key === "F3") {
|
||||
event.preventDefault();
|
||||
if (state.searchMatches.length) {
|
||||
selectSearchMatch(event.shiftKey ? Math.max(0, state.searchIndex) - 1 : state.searchIndex + 1);
|
||||
} else {
|
||||
focusSearch();
|
||||
}
|
||||
focusSearch(event.shiftKey ? -1 : 1);
|
||||
return;
|
||||
}
|
||||
if (key === "Escape" && !event.shiftKey && !el.searchPanel.hidden && (el.pageListPanel.contains(target) || el.viewerPanel.contains(target))) {
|
||||
@@ -11065,13 +11061,14 @@ function copySelection(event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
async function focusSearch() {
|
||||
async function focusSearch(direction = 0) {
|
||||
if (canvasEditor.input || canvasEditor.crop || canvasEditor.nudge || canvasEditor.nudgeCommit) {
|
||||
const tab = documentTab(), content = documentContentKey(state);
|
||||
const current = () => isForegroundDocument(tab) && content === documentContentKey(state);
|
||||
if (!await canvasEditor.commitNudge() || !current() || !await canvasEditor.commitText() || !current()
|
||||
|| !await canvasEditor.commitCrop() || !current() || document.body.hasAttribute("data-busy") || formDialogOpen()) return;
|
||||
}
|
||||
if (direction && state.searchMatches.length) return selectSearchMatch((direction < 0 ? Math.max(0, state.searchIndex) : state.searchIndex) + direction);
|
||||
if (!state.showPages) {
|
||||
toggleSidebar("pages");
|
||||
}
|
||||
|
||||
@@ -1960,6 +1960,7 @@ export class CanvasEditor {
|
||||
}
|
||||
});
|
||||
input.addEventListener("keydown", (event) => {
|
||||
if (event.key === "F3" && !event.ctrlKey && !event.metaKey && !event.altKey) return;
|
||||
if ((event.ctrlKey || event.metaKey) && !event.altKey && (["s", "w", "tab"].includes(event.key.toLowerCase())
|
||||
|| !event.shiftKey && ["f", "o", "p"].includes(event.key.toLowerCase()))) return;
|
||||
event.stopPropagation();
|
||||
|
||||
Reference in new issue
Block a user