mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 21:26:10 +03:00
Added configuration around the rotate left/right buttons. The default for showRotationControls is false to preserve existing functionality. Also added default tooltip strings for the buttons.
This version runts the tests fine locally using 'npm test'. It looks like the remote build was having a timeout issue which I couldn't reproduce.
This commit is contained in:
parent
e8697e5c19
commit
60da75aede
@ -336,6 +336,11 @@
|
|||||||
* image and if the 'next' button will wrap to the first image when viewing
|
* image and if the 'next' button will wrap to the first image when viewing
|
||||||
* the last image.
|
* the last image.
|
||||||
*
|
*
|
||||||
|
* @property {Boolean} [showRotationControl=false]
|
||||||
|
* If true then the rotate left/right controls will be displayed as part of the
|
||||||
|
* standard controls. This is also subject to the browser support for rotate
|
||||||
|
* (e.g. viewer.drawer.canRotate()).
|
||||||
|
*
|
||||||
* @property {Boolean} [showSequenceControl=true]
|
* @property {Boolean} [showSequenceControl=true]
|
||||||
* If the viewer has been configured with a sequence of tile sources, then
|
* If the viewer has been configured with a sequence of tile sources, then
|
||||||
* provide buttons for navigating forward and backward through the images.
|
* provide buttons for navigating forward and backward through the images.
|
||||||
@ -807,6 +812,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
navPrevNextWrap: false,
|
navPrevNextWrap: false,
|
||||||
|
showRotationControl: false,
|
||||||
|
|
||||||
//DEVELOPER SETTINGS
|
//DEVELOPER SETTINGS
|
||||||
debugMode: false,
|
debugMode: false,
|
||||||
|
@ -55,7 +55,9 @@ var I18N = {
|
|||||||
ZoomIn: "Zoom in",
|
ZoomIn: "Zoom in",
|
||||||
ZoomOut: "Zoom out",
|
ZoomOut: "Zoom out",
|
||||||
NextPage: "Next page",
|
NextPage: "Next page",
|
||||||
PreviousPage: "Previous page"
|
PreviousPage: "Previous page",
|
||||||
|
RotateLeft: "Rotate left",
|
||||||
|
RotateRight: "Rotate right"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1234,33 +1234,36 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
onBlur: onBlurHandler
|
onBlur: onBlurHandler
|
||||||
}));
|
}));
|
||||||
|
|
||||||
buttons.push( this.rotateLeft = new $.Button({
|
if (this.showRotationControl && this.drawer.canRotate()) {
|
||||||
element: this.rotateLeftButton ? $.getElement( this.rotateLeftButton ) : null,
|
buttons.push( this.rotateLeft = new $.Button({
|
||||||
clickTimeThreshold: this.clickTimeThreshold,
|
element: this.rotateLeftButton ? $.getElement( this.rotateLeftButton ) : null,
|
||||||
clickDistThreshold: this.clickDistThreshold,
|
clickTimeThreshold: this.clickTimeThreshold,
|
||||||
tooltip: $.getString( "Tooltips.RotateLeft" ),
|
clickDistThreshold: this.clickDistThreshold,
|
||||||
srcRest: resolveUrl( this.prefixUrl, navImages.rotateleft.REST ),
|
tooltip: $.getString( "Tooltips.RotateLeft" ),
|
||||||
srcGroup: resolveUrl( this.prefixUrl, navImages.rotateleft.GROUP ),
|
srcRest: resolveUrl( this.prefixUrl, navImages.rotateleft.REST ),
|
||||||
srcHover: resolveUrl( this.prefixUrl, navImages.rotateleft.HOVER ),
|
srcGroup: resolveUrl( this.prefixUrl, navImages.rotateleft.GROUP ),
|
||||||
srcDown: resolveUrl( this.prefixUrl, navImages.rotateleft.DOWN ),
|
srcHover: resolveUrl( this.prefixUrl, navImages.rotateleft.HOVER ),
|
||||||
onRelease: onRotateLeftHandler,
|
srcDown: resolveUrl( this.prefixUrl, navImages.rotateleft.DOWN ),
|
||||||
onFocus: onFocusHandler,
|
onRelease: onRotateLeftHandler,
|
||||||
onBlur: onBlurHandler
|
onFocus: onFocusHandler,
|
||||||
}));
|
onBlur: onBlurHandler
|
||||||
|
}));
|
||||||
|
|
||||||
buttons.push( this.rotateRight = new $.Button({
|
buttons.push( this.rotateRight = new $.Button({
|
||||||
element: this.rotateRightButton ? $.getElement( this.rotateRightButton ) : null,
|
element: this.rotateRightButton ? $.getElement( this.rotateRightButton ) : null,
|
||||||
clickTimeThreshold: this.clickTimeThreshold,
|
clickTimeThreshold: this.clickTimeThreshold,
|
||||||
clickDistThreshold: this.clickDistThreshold,
|
clickDistThreshold: this.clickDistThreshold,
|
||||||
tooltip: $.getString( "Tooltips.RotateRight" ),
|
tooltip: $.getString( "Tooltips.RotateRight" ),
|
||||||
srcRest: resolveUrl( this.prefixUrl, navImages.rotateright.REST ),
|
srcRest: resolveUrl( this.prefixUrl, navImages.rotateright.REST ),
|
||||||
srcGroup: resolveUrl( this.prefixUrl, navImages.rotateright.GROUP ),
|
srcGroup: resolveUrl( this.prefixUrl, navImages.rotateright.GROUP ),
|
||||||
srcHover: resolveUrl( this.prefixUrl, navImages.rotateright.HOVER ),
|
srcHover: resolveUrl( this.prefixUrl, navImages.rotateright.HOVER ),
|
||||||
srcDown: resolveUrl( this.prefixUrl, navImages.rotateright.DOWN ),
|
srcDown: resolveUrl( this.prefixUrl, navImages.rotateright.DOWN ),
|
||||||
onRelease: onRotateRightHandler,
|
onRelease: onRotateRightHandler,
|
||||||
onFocus: onFocusHandler,
|
onFocus: onFocusHandler,
|
||||||
onBlur: onBlurHandler
|
onBlur: onBlurHandler
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if( useGroup ){
|
if( useGroup ){
|
||||||
this.buttons = new $.ButtonGroup({
|
this.buttons = new $.ButtonGroup({
|
||||||
|
Loading…
Reference in New Issue
Block a user