pdf.js/examples/components
Jonas Jenwald fa8c0ef616 [api-minor] Change PDFFindController to use the "find"-event directly (issue 12731)
Looking at the code, I do have to agree with the point made in issue 12731 about it being unexpected/unhelpful that the `PDFFindController.executeCommand`-method isn't directly usable with the "find"-event.
The reason for it being this way is, as so often, for historical reasons: The `executeCommand`-method was added (just) prior to the introduction of the `EventBus` in the viewer.

Obviously we cannot simply change the existing `PDFFindController.executeCommand`-method, since that'd be a breaking change in code which has existed for over five years.
Initially I figured that we could simply add a new method in `PDFFindController` that'd accept the state from the "find"-event, however after thinking about this and looking through the use-cases in the default viewer I settled on a slightly different approach: Let the `PDFFindController` just listen for the "find"-event (on the `EventBus`-instance) directly instead, which also removes one level of (unneeded) indirection during searching in the default viewer.

For GENERIC builds of the PDF.js library, the old `PDFFindController.executeCommand`-method is still available with a deprecation warning.
2021-10-16 10:36:22 +02:00
..
pageviewer.html Remove moznomarginboxes 2018-01-19 22:05:50 +01:00
pageviewer.js Enable XFA by default in the viewer, and components/ examples (issue 13968) 2021-09-14 16:54:36 +02:00
simpleviewer.html Remove moznomarginboxes 2018-01-19 22:05:50 +01:00
simpleviewer.js [api-minor] Change PDFFindController to use the "find"-event directly (issue 12731) 2021-10-16 10:36:22 +02:00
singlepageviewer.html Remove moznomarginboxes 2018-01-19 22:05:50 +01:00
singlepageviewer.js [api-minor] Change PDFFindController to use the "find"-event directly (issue 12731) 2021-10-16 10:36:22 +02:00