Added setMouseNavEnabled() and isMouseNavEnabled() method overrides to Navigator (#572)

This commit is contained in:
Mark Salsbery 2015-01-20 11:01:09 -08:00
parent 2bd105042a
commit 198d4de0e6
2 changed files with 31 additions and 0 deletions

View File

@ -20,6 +20,7 @@ OPENSEADRAGON CHANGELOG
* Requesting keyboard focus when viewer is clicked (#537)
* Arrow key navigation fixed across platforms (#565)
* Removed textarea element from viewer DOM. Viewer.canvas now handles keyboard navigation (#569)
* Added setMouseNavEnabled() and isMouseNavEnabled() method overrides to Navigator (#572)
1.2.0:

View File

@ -229,6 +229,36 @@ $.Navigator = function( options ){
$.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /** @lends OpenSeadragon.Navigator.prototype */{
/**
* @function
* @return {Boolean}
*/
isMouseNavEnabled: function () {
return this.element.innerTracker.isTracking();
},
/**
* @function
* @param {Boolean} enabled - true to enable, false to disable
* @return {OpenSeadragon.Navigator} Chainable.
* @fires OpenSeadragon.Navigator.event:mouse-enabled
*/
setMouseNavEnabled: function( enabled ){
this.element.innerTracker.setTracking( enabled );
/**
* Raised when mouse/touch navigation is enabled or disabled (see {@link OpenSeadragon.Navigator#setMouseNavEnabled}).
*
* @event mouse-enabled
* @memberof OpenSeadragon.Navigator
* @type {object}
* @property {OpenSeadragon.Navigator} eventSource - A reference to the Navigator which raised the event.
* @property {Boolean} enabled
* @property {?Object} userData - Arbitrary subscriber-defined object.
*/
this.raiseEvent( 'mouse-enabled', { enabled: enabled } );
return this;
},
/**
* Used to notify the navigator when its size has changed.
* Especially useful when {@link OpenSeadragon.Options}.navigatorAutoResize is set to false and the navigator is resizable.