Backing out an event handler change

This commit is contained in:
houseofyin 2013-04-02 21:06:07 -04:00
parent cfd5e67462
commit 569a816df4

View File

@ -149,27 +149,25 @@ $.Button = function( options ) {
tracker: tracker, tracker: tracker,
position: position, position: position,
buttonDownElement: buttonDownElement, buttonDownElement: buttonDownElement,
buttonDownAny: buttonDownAny, buttonDownAny: buttonDownAny
originalEvent: event
}); });
} else if ( !buttonDownAny ) { } else if ( !buttonDownAny ) {
inTo( _this, $.ButtonState.HOVER ); inTo( _this, $.ButtonState.HOVER );
} }
}, },
focusHandler: function( tracker, position, buttonDownElement, buttonDownAny, event ) { focusHandler: function( tracker, position, buttonDownElement, buttonDownAny ) {
this.enterHandler( tracker, position, buttonDownElement, buttonDownAny, event ); this.enterHandler( tracker, position, buttonDownElement, buttonDownAny );
_this.raiseEvent( "focus", { _this.raiseEvent( "focus", {
button: _this, button: _this,
tracker: tracker, tracker: tracker,
position: position, position: position,
buttonDownElement: buttonDownElement, buttonDownElement: buttonDownElement,
buttonDownAny: buttonDownAny, buttonDownAny: buttonDownAny
originalEvent: event
}); });
}, },
exitHandler: function( tracker, position, buttonDownElement, buttonDownAny, event ) { exitHandler: function( tracker, position, buttonDownElement, buttonDownAny ) {
outTo( _this, $.ButtonState.GROUP ); outTo( _this, $.ButtonState.GROUP );
if ( buttonDownElement ) { if ( buttonDownElement ) {
_this.raiseEvent( "exit", { _this.raiseEvent( "exit", {
@ -177,35 +175,32 @@ $.Button = function( options ) {
tracker: tracker, tracker: tracker,
position: position, position: position,
buttonDownElement: buttonDownElement, buttonDownElement: buttonDownElement,
buttonDownAny: buttonDownAny, buttonDownAny: buttonDownAny
originalEvent: event
}); });
} }
}, },
blurHandler: function( tracker, position, buttonDownElement, buttonDownAny, event ) { blurHandler: function( tracker, position, buttonDownElement, buttonDownAny ) {
this.exitHandler( tracker, position, buttonDownElement, buttonDownAny, event ); this.exitHandler( tracker, position, buttonDownElement, buttonDownAny );
_this.raiseEvent( "blur", { _this.raiseEvent( "blur", {
button: _this, button: _this,
tracker: tracker, tracker: tracker,
position: position, position: position,
buttonDownElement: buttonDownElement, buttonDownElement: buttonDownElement,
buttonDownAny: buttonDownAny, buttonDownAny: buttonDownAny
originalEvent: event
}); });
}, },
pressHandler: function( tracker, position, event ) { pressHandler: function( tracker, position ) {
inTo( _this, $.ButtonState.DOWN ); inTo( _this, $.ButtonState.DOWN );
_this.raiseEvent( "press", { _this.raiseEvent( "press", {
button: _this, button: _this,
tracker: tracker, tracker: tracker,
position: position, position: position
originalEvent: event
}); });
}, },
releaseHandler: function( tracker, position, insideElementPress, insideElementRelease, event ) { releaseHandler: function( tracker, position, insideElementPress, insideElementRelease ) {
if ( insideElementPress && insideElementRelease ) { if ( insideElementPress && insideElementRelease ) {
outTo( _this, $.ButtonState.HOVER ); outTo( _this, $.ButtonState.HOVER );
_this.raiseEvent( "release", { _this.raiseEvent( "release", {
@ -213,8 +208,7 @@ $.Button = function( options ) {
tracker: tracker, tracker: tracker,
position: position, position: position,
insideElementPress: insideElementPress, insideElementPress: insideElementPress,
insideElementRelease: insideElementRelease, insideElementRelease: insideElementRelease
originalEvent: event
}); });
} else if ( insideElementPress ) { } else if ( insideElementPress ) {
outTo( _this, $.ButtonState.GROUP ); outTo( _this, $.ButtonState.GROUP );
@ -223,27 +217,25 @@ $.Button = function( options ) {
} }
}, },
clickHandler: function( tracker, position, quick, shift, event ) { clickHandler: function( tracker, position, quick, shift ) {
if ( quick ) { if ( quick ) {
_this.raiseEvent("click", { _this.raiseEvent("click", {
button: _this, button: _this,
tracker: tracker, tracker: tracker,
position: position, position: position,
quick: quick, quick: quick,
shift: shift, shift: shift
originalEvent: event
}); });
} }
}, },
keyHandler: function( tracker, key, event ){ keyHandler: function( tracker, key ){
//console.log( "%s : handling key %s!", _this.tooltip, key); //console.log( "%s : handling key %s!", _this.tooltip, key);
if( 13 === key ){ if( 13 === key ){
_this.raiseEvent( "keypress", { _this.raiseEvent( "keypress", {
button: _this, button: _this,
tracker: tracker, tracker: tracker,
key: key, key: key
originalEvent: event
}); });
return false; return false;
} }