Skip to content

Fix onPageChanged handler not firing#36

Open
alexmitchelldev wants to merge 1 commit into
Servoy:masterfrom
alexmitchelldev:fix/on-page-changed-event
Open

Fix onPageChanged handler not firing#36
alexmitchelldev wants to merge 1 commit into
Servoy:masterfrom
alexmitchelldev:fix/on-page-changed-event

Conversation

@alexmitchelldev

Copy link
Copy Markdown

This pull requests fixes an issue with the onPageChanged event not firing.

Summary

  • The onPageChanged handler was defined in pdfJsViewer.spec but never wired up in the AngularJS directive (pdfJsViewer.js), so the event never fired.
  • Added handlers: "=svyHandlers" to the directive's scope bindings to expose handler functions.
  • Registered a pagechanging listener on the PDF.js eventBus inside renderFinished(), calling the handler directly without $scope.$apply() to avoid digest cycle collisions that prevented the event from firing during upward page navigation.

Fix onPageChanged handler not firing in pdfJsViewer

The onPageChanged handler was defined in pdfJsViewer.spec but never
wired up in the AngularJS directive, so the event never fired.

Added handlers scope binding and registered a pagechanging listener
on the PDF.js eventBus. The handler is called directly without
$scope.$apply() to avoid digest cycle collisions during upward
page navigation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant