Skip to content

Commit

Permalink
Move event name into events.js internetarchive#460
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaitanya31612 committed Nov 22, 2020
1 parent 2523df5 commit 0a5f4e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/js/BookReader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ BookReader.prototype.updateFirstIndex = function(
if (this.options.initialSearchTerm && !suppressFragmentChange) {
this.suppressFragmentChange = false;
}
this.trigger('pageChanged');
this.trigger(EVENTS.pageChanged);
this.updateNavIndexThrottled(index);
};

Expand Down
6 changes: 3 additions & 3 deletions src/js/BookReader/Mode2Up.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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 @@ -670,7 +670,7 @@ export class Mode2Up {
this.br.refs.$brContainer.removeClass("BRpageFlipping");

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

this.br.textSelectionPlugin?.stopPageFlip(this.br.refs.$brContainer);
this.br.trigger('pageChanged');
this.br.trigger(EVENTS.pageChanged);
});
});
}
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'
};

0 comments on commit 0a5f4e6

Please sign in to comment.