mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +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") {
|
if (key === "F3") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (state.searchMatches.length) {
|
focusSearch(event.shiftKey ? -1 : 1);
|
||||||
selectSearchMatch(event.shiftKey ? Math.max(0, state.searchIndex) - 1 : state.searchIndex + 1);
|
|
||||||
} else {
|
|
||||||
focusSearch();
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (key === "Escape" && !event.shiftKey && !el.searchPanel.hidden && (el.pageListPanel.contains(target) || el.viewerPanel.contains(target))) {
|
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();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function focusSearch() {
|
async function focusSearch(direction = 0) {
|
||||||
if (canvasEditor.input || canvasEditor.crop || canvasEditor.nudge || canvasEditor.nudgeCommit) {
|
if (canvasEditor.input || canvasEditor.crop || canvasEditor.nudge || canvasEditor.nudgeCommit) {
|
||||||
const tab = documentTab(), content = documentContentKey(state);
|
const tab = documentTab(), content = documentContentKey(state);
|
||||||
const current = () => isForegroundDocument(tab) && content === documentContentKey(state);
|
const current = () => isForegroundDocument(tab) && content === documentContentKey(state);
|
||||||
if (!await canvasEditor.commitNudge() || !current() || !await canvasEditor.commitText() || !current()
|
if (!await canvasEditor.commitNudge() || !current() || !await canvasEditor.commitText() || !current()
|
||||||
|| !await canvasEditor.commitCrop() || !current() || document.body.hasAttribute("data-busy") || formDialogOpen()) return;
|
|| !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) {
|
if (!state.showPages) {
|
||||||
toggleSidebar("pages");
|
toggleSidebar("pages");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1960,6 +1960,7 @@ export class CanvasEditor {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
input.addEventListener("keydown", (event) => {
|
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())
|
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.shiftKey && ["f", "o", "p"].includes(event.key.toLowerCase()))) return;
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|||||||
Reference in new issue
Block a user