[GENERIC viewer] Simplify the keyboard find-again state building
By using modern JavaScript features, we can ever so slightly reduce the amount of code needed here.
This commit is contained in:
parent
d6178a13d7
commit
d9181236b2
@ -2954,12 +2954,12 @@ function webViewerKeyDown(evt) {
|
||||
if (!PDFViewerApplication.supportsIntegratedFind) {
|
||||
const { state } = PDFViewerApplication.findController;
|
||||
if (state) {
|
||||
const eventState = Object.assign(Object.create(null), state, {
|
||||
const newState = {
|
||||
source: window,
|
||||
type: "again",
|
||||
findPrevious: cmd === 5 || cmd === 12,
|
||||
});
|
||||
eventBus.dispatch("find", eventState);
|
||||
};
|
||||
eventBus.dispatch("find", { ...state, ...newState });
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user