From 0a5f4e6645a975092e5a864181de9687c346a401 Mon Sep 17 00:00:00 2001 From: Chaitanya31612 Date: Sun, 22 Nov 2020 23:51:37 +0530 Subject: [PATCH 1/3] Move event name into events.js #460 --- src/js/BookReader.js | 2 +- src/js/BookReader/Mode2Up.js | 6 +++--- src/js/BookReader/events.js | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/js/BookReader.js b/src/js/BookReader.js index e8a08abf1..c8c76a26c 100644 --- a/src/js/BookReader.js +++ b/src/js/BookReader.js @@ -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); }; diff --git a/src/js/BookReader/Mode2Up.js b/src/js/BookReader/Mode2Up.js index 1891011b7..9b53f65f8 100644 --- a/src/js/BookReader/Mode2Up.js +++ b/src/js/BookReader/Mode2Up.js @@ -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); } /** @@ -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); }); }); } @@ -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); }); }); } diff --git a/src/js/BookReader/events.js b/src/js/BookReader/events.js index 8f0cd9853..e581ee121 100644 --- a/src/js/BookReader/events.js +++ b/src/js/BookReader/events.js @@ -17,4 +17,5 @@ export const EVENTS = { /* currently 3 represents thumbnail view */ '3PageViewSelected': '3PageViewSelected', mobileNavOpen: 'mobileNavOpen', + pageChanged = 'pageChanged' }; From 4c0a8d9d97cdf0b80c3e47a6954167d6e6704ec6 Mon Sep 17 00:00:00 2001 From: Chaitanya31612 Date: Tue, 1 Dec 2020 15:45:55 +0530 Subject: [PATCH 2/3] Move event name into events.js #460 --- src/js/BookReader/events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/BookReader/events.js b/src/js/BookReader/events.js index e581ee121..18dd0c1d5 100644 --- a/src/js/BookReader/events.js +++ b/src/js/BookReader/events.js @@ -17,5 +17,5 @@ export const EVENTS = { /* currently 3 represents thumbnail view */ '3PageViewSelected': '3PageViewSelected', mobileNavOpen: 'mobileNavOpen', - pageChanged = 'pageChanged' + pageChanged: 'pageChanged' }; From bd3a09cfa13c194cd0de0e9ae0c7cdb7368ab1ab Mon Sep 17 00:00:00 2001 From: Chaitanya31612 Date: Tue, 1 Dec 2020 16:09:40 +0530 Subject: [PATCH 3/3] Move event name into events.js #460 --- src/js/BookReader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/BookReader.js b/src/js/BookReader.js index c8c76a26c..f3ebde7ae 100644 --- a/src/js/BookReader.js +++ b/src/js/BookReader.js @@ -1795,7 +1795,7 @@ BookReader.prototype.updateFirstIndex = function( if (this.options.initialSearchTerm && !suppressFragmentChange) { this.suppressFragmentChange = false; } - this.trigger(EVENTS.pageChanged); + this.trigger(BookReader.eventNames.pageChanged); this.updateNavIndexThrottled(index); };