[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) {
|
if (!PDFViewerApplication.supportsIntegratedFind) {
|
||||||
const { state } = PDFViewerApplication.findController;
|
const { state } = PDFViewerApplication.findController;
|
||||||
if (state) {
|
if (state) {
|
||||||
const eventState = Object.assign(Object.create(null), state, {
|
const newState = {
|
||||||
source: window,
|
source: window,
|
||||||
type: "again",
|
type: "again",
|
||||||
findPrevious: cmd === 5 || cmd === 12,
|
findPrevious: cmd === 5 || cmd === 12,
|
||||||
});
|
};
|
||||||
eventBus.dispatch("find", eventState);
|
eventBus.dispatch("find", { ...state, ...newState });
|
||||||
}
|
}
|
||||||
handled = true;
|
handled = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user