mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-28 16:16:08 +03:00
Merge branch 'master' of github.com:robhobbes/openseadragon into robhobbes-master
Fixed Conflicts: changelog.txt
This commit is contained in:
commit
9c60b28ec3
@ -12,6 +12,7 @@ OPENSEADRAGON CHANGELOG
|
||||
* Better requestAnimationFrame detection on older Firefox (#103)
|
||||
* More efficient navigator loading (#115)
|
||||
* Sometimes tiles wouldn't resolve if you used the blendTime option; fixed. (#95)
|
||||
* You can now choose to have previous and next buttons wrap using the config.navPrevNextWrap.
|
||||
|
||||
0.9.127:
|
||||
|
||||
|
@ -251,6 +251,11 @@
|
||||
* these paths, prefer setting the option.prefixUrl rather than overriding
|
||||
* every image path directly through this setting.
|
||||
*
|
||||
* @param {Boolean} [options.navPrevNextWrap=false]
|
||||
* If the 'previous' button will wrap to the last image when viewing the first
|
||||
* image and if the 'next' button will wrap to the first image when viewing
|
||||
* the last image.
|
||||
*
|
||||
* @returns {OpenSeadragon.Viewer}
|
||||
*/
|
||||
window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
@ -588,6 +593,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
DOWN: 'next_pressed.png'
|
||||
}
|
||||
},
|
||||
navPrevNextWrap: false,
|
||||
|
||||
//DEVELOPER SETTINGS
|
||||
debugMode: false,
|
||||
|
@ -345,6 +345,10 @@ $.Viewer = function( options ) {
|
||||
beginControlsAutoHide( _this );
|
||||
} ); // initial fade out
|
||||
|
||||
if(this.navPrevNextWrap){
|
||||
this.previousButton.enable();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, {
|
||||
@ -1021,7 +1025,9 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
||||
if( this.nextButton ){
|
||||
if( ( this.tileSources.length - 1 ) === page ){
|
||||
//Disable next button
|
||||
if(!this.navPrevNextWrap){
|
||||
this.nextButton.disable();
|
||||
}
|
||||
} else {
|
||||
this.nextButton.enable();
|
||||
}
|
||||
@ -1031,9 +1037,11 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
||||
//Enable previous button
|
||||
this.previousButton.enable();
|
||||
} else {
|
||||
if(!this.navPrevNextWrap){
|
||||
this.previousButton.disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.open( this.tileSources[ page ] );
|
||||
}
|
||||
@ -1624,12 +1632,18 @@ function onFullPage() {
|
||||
|
||||
function onPrevious(){
|
||||
var previous = THIS[ this.hash ].sequence - 1;
|
||||
if(this.navPrevNextWrap && previous < 0){
|
||||
previous += this.tileSources.length;
|
||||
}
|
||||
this.goToPage( previous );
|
||||
}
|
||||
|
||||
|
||||
function onNext(){
|
||||
var next = THIS[ this.hash ].sequence + 1;
|
||||
if(this.navPrevNextWrap && next >= this.tileSources.length){
|
||||
next = 0;
|
||||
}
|
||||
this.goToPage( next );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user