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

Move event name into events.js #460 #559

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/BookReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ BookReader.prototype.updateFirstIndex = function(
if (this.options.initialSearchTerm && !suppressFragmentChange) {
this.suppressFragmentChange = false;
}
this.trigger('pageChanged');
this.trigger(BookReader.eventNames.pageChanged);
this.updateNavIndexThrottled(index);
};

Expand Down
8 changes: 6 additions & 2 deletions src/js/BookReader/Mode2Up.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Mode2Up {
this.setMouseHandlers();
this.br.displayedIndices = this.displayedIndices;
this.br.updateToolbarZoom(this.br.reduce);
this.br.trigger('pageChanged');
this.br.trigger(EVENTS.pageChanged);
}

/**
Expand Down Expand Up @@ -691,7 +691,7 @@ export class Mode2Up {
this.br.refs.$brContainer.removeClass("BRpageFlipping");
this.br.textSelectionPlugin?.stopPageFlip(this.br.refs.$brContainer);
this.centerView();
this.br.trigger('pageChanged');
this.br.trigger(EVENTS.pageChanged);

// get next previous batch immediately this.br.pruneUnusedImgs();
if (!this.br.prefetchedImgs[newIndexL - 2]) {
Expand Down Expand Up @@ -842,6 +842,9 @@ export class Mode2Up {

this.br.refs.$brContainer.removeClass("BRpageFlipping");
this.br.textSelectionPlugin?.stopPageFlip(this.br.refs.$brContainer);
<<<<<<< HEAD
this.br.trigger(EVENTS.pageChanged);
=======
this.centerView();
this.br.trigger('pageChanged');

Expand All @@ -858,6 +861,7 @@ export class Mode2Up {
this.br.prefetchImg(newIndexL + 3);
this.br.prefetchImg(newIndexR + 3);
}, 250);
>>>>>>> 639833ae94fa261b59091627d8e14b86b3109ad8
});
});
}
Expand Down
1 change: 1 addition & 0 deletions src/js/BookReader/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export const EVENTS = {
/* currently 3 represents thumbnail view */
'3PageViewSelected': '3PageViewSelected',
mobileNavOpen: 'mobileNavOpen',
pageChanged: 'pageChanged'
};