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 * @function
* @name OpenSeadragon.Viewer.prototype.currentPage * @name OpenSeadragon.Viewer.prototype.currentPage
* @return {Number} * @return {Number}
@ -1091,36 +1092,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
return THIS[ this.hash ].sequence; 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 * @function
* @name OpenSeadragon.Viewer.prototype.goToPage * @name OpenSeadragon.Viewer.prototype.goToPage
@ -1152,6 +1123,36 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
return this; 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 * Display a message in the viewport
* @function * @function