diff --git a/changelog.txt b/changelog.txt index ed49d13d..e0a71be4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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) diff --git a/src/button.js b/src/button.js index 062abf8a..cc7febb7 100644 --- a/src/button.js +++ b/src/button.js @@ -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;