Merge pull request #575 from msalsbery/navigator_disable

Added setMouseNavEnabled() support in Navigator
This commit is contained in:
Ian Gilman 2015-01-21 09:59:47 -08:00
commit e966f3eafb
2 changed files with 13 additions and 25 deletions

View File

@ -22,6 +22,7 @@ OPENSEADRAGON CHANGELOG
* Removed textarea element from viewer DOM. Viewer.canvas now handles keyboard navigation (#569)
* Removed 'position' property from MouseTracker keyDownHandler/keyUpHandler/keyHandler functions (#573)
* Fixed pointer event model detection for IE 10 and IE 11 (#571)
* Added setMouseNavEnabled() support to Navigator (#572)
1.2.0:

View File

@ -52,8 +52,7 @@ $.Navigator = function( options ){
var viewer = options.viewer,
_this = this,
viewerSize,
navigatorSize,
unneededElement;
navigatorSize;
//We may need to create a new element and id if they did not
//provide the id for the existing element
@ -168,24 +167,6 @@ $.Navigator = function( options ){
this.displayRegionContainer.style.width = "100%";
this.displayRegionContainer.style.height = "100%";
this.element.innerTracker = new $.MouseTracker({
element: this.element,
dragHandler: $.delegate( this, onCanvasDrag ),
clickHandler: $.delegate( this, onCanvasClick ),
releaseHandler: $.delegate( this, onCanvasRelease ),
scrollHandler: $.delegate( this, onCanvasScroll )
}).setTracking( true );
/*this.displayRegion.outerTracker = new $.MouseTracker({
element: this.container,
clickTimeThreshold: this.clickTimeThreshold,
clickDistThreshold: this.clickDistThreshold,
enterHandler: $.delegate( this, onContainerEnter ),
exitHandler: $.delegate( this, onContainerExit ),
releaseHandler: $.delegate( this, onContainerRelease )
}).setTracking( this.mouseNavEnabled ? true : false ); // always tracking*/
viewer.addControl(
this.element,
options.controlOptions
@ -211,10 +192,6 @@ $.Navigator = function( options ){
this.displayRegionContainer.appendChild(this.displayRegion);
this.element.getElementsByTagName('div')[0].appendChild(this.displayRegionContainer);
unneededElement = this.element.getElementsByTagName('textarea')[0];
if (unneededElement) {
unneededElement.parentNode.removeChild(unneededElement);
}
if (options.navigatorRotate)
{
@ -223,8 +200,18 @@ $.Navigator = function( options ){
_setTransformRotate(_this.displayRegion, -args.degrees);
_this.viewport.setRotation(args.degrees);
});
}
// Remove the base class' (Viewer's) innerTracker and replace it with our own
this.innerTracker.destroy();
this.innerTracker = new $.MouseTracker({
element: this.element,
dragHandler: $.delegate( this, onCanvasDrag ),
clickHandler: $.delegate( this, onCanvasClick ),
releaseHandler: $.delegate( this, onCanvasRelease ),
scrollHandler: $.delegate( this, onCanvasScroll )
}).setTracking( true );
};
$.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /** @lends OpenSeadragon.Navigator.prototype */{