mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Merge pull request #241 from msalsbery/Button-Event-Signatures
Button event signatures fixed for consistency (#224)
This commit is contained in:
commit
3dbad58ad6
@ -3,7 +3,6 @@ OPENSEADRAGON CHANGELOG
|
||||
|
||||
1.0.0: (in progress)
|
||||
|
||||
* BREAKING CHANGE: TileSource 'ready' event handler signature changed for consistency to 'handlerMethod( eventSource, eventData)' (#239)
|
||||
* BREAKING CHANGE: Renamed EventHandler to EventSource (#225)
|
||||
* BREAKING CHANGE: MouseTracker event handler method signatures changed to 'handlerMethod( tracker, eventData)' (#23)
|
||||
* BREAKING CHANGE: Event names changed for consistency: changed to lower case, compound names hyphenated, and "on" prefixes removed (#226):
|
||||
@ -16,6 +15,8 @@ OPENSEADRAGON CHANGELOG
|
||||
* Button "onExit" changed to "exit"
|
||||
* Button "onFocus" changed to "focus"
|
||||
* Button "onBlur" changed to "blur"
|
||||
* BREAKING CHANGE: Button event handler method signatures changed to 'handlerMethod( eventSource, eventData)' where eventData == { button } (#224)
|
||||
* BREAKING CHANGE: TileSource 'ready' event handler signature changed to 'handlerMethod( eventSource, eventData)' where eventData == { tileSource } (#239)
|
||||
* MouseTracker now passes the original event objects to its handler methods (#23)
|
||||
* MouseTracker now supports an optional 'moveHandler' method for tracking mousemove events (#215)
|
||||
* Fixed: Element-relative mouse coordinates now correct if the element and/or page is scrolled (using new OpenSeadragon.getElementOffset() method) (#131)
|
||||
|
@ -178,7 +178,7 @@ $.Button = function( options ) {
|
||||
enterHandler: function( tracker, eventData ) {
|
||||
if ( eventData.insideElementPressed ) {
|
||||
inTo( _this, $.ButtonState.DOWN );
|
||||
_this.raiseEvent( "enter", _this );
|
||||
_this.raiseEvent( "enter", { button: _this } );
|
||||
} else if ( !eventData.buttonDownAny ) {
|
||||
inTo( _this, $.ButtonState.HOVER );
|
||||
}
|
||||
@ -186,30 +186,30 @@ $.Button = function( options ) {
|
||||
|
||||
focusHandler: function ( tracker, eventData ) {
|
||||
this.enterHandler( tracker, eventData );
|
||||
_this.raiseEvent( "focus", _this );
|
||||
_this.raiseEvent( "focus", { button: _this } );
|
||||
},
|
||||
|
||||
exitHandler: function( tracker, eventData ) {
|
||||
outTo( _this, $.ButtonState.GROUP );
|
||||
if ( eventData.insideElementPressed ) {
|
||||
_this.raiseEvent( "exit", _this );
|
||||
_this.raiseEvent( "exit", { button: _this } );
|
||||
}
|
||||
},
|
||||
|
||||
blurHandler: function ( tracker, eventData ) {
|
||||
this.exitHandler( tracker, eventData );
|
||||
_this.raiseEvent( "blur", _this );
|
||||
_this.raiseEvent( "blur", { button: _this } );
|
||||
},
|
||||
|
||||
pressHandler: function ( tracker, eventData ) {
|
||||
inTo( _this, $.ButtonState.DOWN );
|
||||
_this.raiseEvent( "press", _this );
|
||||
_this.raiseEvent( "press", { button: _this } );
|
||||
},
|
||||
|
||||
releaseHandler: function( tracker, eventData ) {
|
||||
if ( eventData.insideElementPressed && eventData.insideElementReleased ) {
|
||||
outTo( _this, $.ButtonState.HOVER );
|
||||
_this.raiseEvent( "release", _this );
|
||||
_this.raiseEvent( "release", { button: _this } );
|
||||
} else if ( eventData.insideElementPressed ) {
|
||||
outTo( _this, $.ButtonState.GROUP );
|
||||
} else {
|
||||
@ -219,15 +219,15 @@ $.Button = function( options ) {
|
||||
|
||||
clickHandler: function( tracker, eventData ) {
|
||||
if ( eventData.quick ) {
|
||||
_this.raiseEvent("click", _this);
|
||||
_this.raiseEvent("click", { button: _this });
|
||||
}
|
||||
},
|
||||
|
||||
keyHandler: function( tracker, eventData ){
|
||||
//console.log( "%s : handling key %s!", _this.tooltip, eventData.keyCode);
|
||||
if( 13 === eventData.keyCode ){
|
||||
_this.raiseEvent( "click", _this );
|
||||
_this.raiseEvent( "release", _this );
|
||||
_this.raiseEvent( "click", { button: _this } );
|
||||
_this.raiseEvent( "release", { button: _this } );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user