Trying again to backout button.js changes

This commit is contained in:
houseofyin 2013-04-03 13:36:55 -04:00
parent b352fe711b
commit 4c126dd39a

View File

@ -141,81 +141,41 @@ $.Button = function( options ) {
clickTimeThreshold: this.clickTimeThreshold, clickTimeThreshold: this.clickTimeThreshold,
clickDistThreshold: this.clickDistThreshold, clickDistThreshold: this.clickDistThreshold,
enterHandler: function( tracker, position, buttonDownElement, buttonDownAny, event ) { enterHandler: function( tracker, position, buttonDownElement, buttonDownAny ) {
if ( buttonDownElement ) { if ( buttonDownElement ) {
inTo( _this, $.ButtonState.DOWN ); inTo( _this, $.ButtonState.DOWN );
_this.raiseEvent( "enter", { _this.raiseEvent( "onEnter", _this );
button: _this,
tracker: tracker,
position: position,
buttonDownElement: buttonDownElement,
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( "onFocus", _this );
button: _this,
tracker: tracker,
position: position,
buttonDownElement: buttonDownElement,
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( "onExit", _this );
button: _this,
tracker: tracker,
position: position,
buttonDownElement: buttonDownElement,
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( "onBlur", _this );
button: _this,
tracker: tracker,
position: position,
buttonDownElement: buttonDownElement,
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( "onPress", _this );
button: _this,
tracker: tracker,
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( "onRelease", _this );
button: _this,
tracker: tracker,
position: position,
insideElementPress: insideElementPress,
insideElementRelease: insideElementRelease,
originalEvent: event
});
} else if ( insideElementPress ) { } else if ( insideElementPress ) {
outTo( _this, $.ButtonState.GROUP ); outTo( _this, $.ButtonState.GROUP );
} else { } else {
@ -223,28 +183,17 @@ $.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("onClick", _this);
button: _this,
tracker: tracker,
position: position,
quick: quick,
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( "onClick", _this );
button: _this, _this.raiseEvent( "onRelease", _this );
tracker: tracker,
key: key,
originalEvent: event
});
return false; return false;
} }
return true; return true;