Update viewer.js

description; Move _updateSequenceButtons behind goToPage()
This commit is contained in:
Sharpbarb 2013-10-10 12:27:49 -07:00
parent a862870883
commit 6b90687ab4

View File

@ -1083,6 +1083,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
},
/**
* Gets the active page of a sequence
* @function
* @name OpenSeadragon.Viewer.prototype.currentPage
* @return {Number}
@ -1090,36 +1091,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
currentPage: function () {
return THIS[ this.hash ].sequence;
},
/**
* Updates the sequence buttons.
* @function
* @private
* @param {Number} Sequence Value
*/
_updateSequenceButtons: function (page) {
if( this.nextButton ){
if( ( this.tileSources.length - 1 ) === page ){
//Disable next button
if(!this.navPrevNextWrap){
this.nextButton.disable();
}
} else {
this.nextButton.enable();
}
}
if( this.previousButton ){
if( page > 0 ){
//Enable previous button
this.previousButton.enable();
} else {
if(!this.navPrevNextWrap){
this.previousButton.disable();
}
}
}
},
/**
* @function
@ -1152,6 +1123,36 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
return this;
},
/**
* Updates the sequence buttons.
* @function
* @private
* @param {Number} Sequence Value
*/
_updateSequenceButtons: function (page) {
if( this.nextButton ){
if( ( this.tileSources.length - 1 ) === page ){
//Disable next button
if(!this.navPrevNextWrap){
this.nextButton.disable();
}
} else {
this.nextButton.enable();
}
}
if( this.previousButton ){
if( page > 0 ){
//Enable previous button
this.previousButton.enable();
} else {
if(!this.navPrevNextWrap){
this.previousButton.disable();
}
}
}
},
/**
* Display a message in the viewport
* @function