From 1a6aac578bf8245e54028c7a953efb5fd4990c0c Mon Sep 17 00:00:00 2001 From: Nikolaj Mikkelsen Date: Tue, 24 Oct 2017 15:18:57 +0200 Subject: [PATCH] Fix for #1085 - goToPage : event sent before updating the index --- src/viewer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index dc1d7438..c7a2e7fd 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1842,8 +1842,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * @property {Number} page - The page index. * @property {?Object} userData - Arbitrary subscriber-defined object. */ - this.raiseEvent( 'page', { page: page } ); - this._sequenceIndex = page; this._updateSequenceButtons( page ); @@ -1853,6 +1851,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, if( this.referenceStrip ){ this.referenceStrip.setFocus( page ); } + + this.raiseEvent( 'page', { page: page } ); } return this;