mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-31 23:21:42 +03:00
Update viewer.js
description; Move _updateSequenceButtons behind goToPage()
This commit is contained in:
parent
a862870883
commit
6b90687ab4
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user