Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export EVENTS #1133

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Export EVENTS #1133

wants to merge 16 commits into from

Conversation

MrMYHuang
Copy link
Contributor

This commit exports epub.js EVENTS. For examples, we can use these events to update information after epub.js views are resized.

My one app demos the use:
Subscribe EVENTS.RENDITION.DISPLAYED:
https://github.com/MrMYHuang/cbetar2/blob/a96df3a088af2a97e44f0f74750ef50f491132fb/src/pages/EPubViewPage.tsx#L379-L381
After EVENTS.RENDITION.DISPLAYED (e.g. triggered by resizing browser window), we can use rendition.currentLocation() to get the new current page and the new total pages. Then, we can use them to update and render views.
https://github.com/MrMYHuang/cbetar2/blob/a96df3a088af2a97e44f0f74750ef50f491132fb/src/pages/EPubViewPage.tsx#L411-L414

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.

None yet

2 participants