Convert GrabToPan
to a standard class
#14255
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[web/grab_to_pan.js] Inline the
isLeftMouseReleased
helper functionGiven the support information listed in the function itself, the MDN compatibility data, and the currently supported browsers in the PDF.js project we should be able to simplify the code by inlining the function instead.
Convert
GrabToPan
to a standardclass
This code is the last piece[1] of the viewer that's not using standard
class
es, and by converting this code we get rid of some now unneeded boilerplate code (slightly reducing the size of the builtweb/viewer.js
file).Note that while this code was originally imported from a separate repository, it was last sync-ed with upstream five years ago which is why this re-factoring should be OK as far as I'm concerned (and we've done some other clean-up since then as well).
[1] Technically the
web/debugger.js
file is left as well, however that code is first of all not bundled in the builtweb/viewer.js
file and secondly it's not even loaded by default either.