diff --git a/src/viewer.js b/src/viewer.js index a5c7365a..78872afc 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1835,6 +1835,16 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, */ goToPage: function( page ){ if( this.tileSources && page >= 0 && page < this.tileSources.length ){ + this._sequenceIndex = page; + + this._updateSequenceButtons( page ); + + this.open( this.tileSources[ page ] ); + + if( this.referenceStrip ){ + this.referenceStrip.setFocus( page ); + } + /** * Raised when the page is changed on a viewer configured with multiple image sources (see {@link OpenSeadragon.Viewer#goToPage}). * @@ -1846,16 +1856,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * @property {?Object} userData - Arbitrary subscriber-defined object. */ this.raiseEvent( 'page', { page: page } ); - - this._sequenceIndex = page; - - this._updateSequenceButtons( page ); - - this.open( this.tileSources[ page ] ); - - if( this.referenceStrip ){ - this.referenceStrip.setFocus( page ); - } } return this;