mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Interaction: Added some comments.
This commit is contained in:
parent
3c6e8a7b91
commit
a87c1dc068
20
ui/jquery.ui.interaction.js
vendored
20
ui/jquery.ui.interaction.js
vendored
@ -27,6 +27,20 @@ $.widget( "ui.interaction", {
|
||||
}
|
||||
},
|
||||
|
||||
/** abstract methods **/
|
||||
|
||||
// _start: function( event, pointerPosition )
|
||||
// _move: function( event, pointerPosition )
|
||||
// _stop: function( event, pointerPosition )
|
||||
|
||||
/** protected **/
|
||||
|
||||
_isValidTarget: function( target ) {
|
||||
return true;
|
||||
},
|
||||
|
||||
/** internal **/
|
||||
|
||||
// a pass through to _interactionStart() which tracks the hook that was used
|
||||
_startProxy: function( hook ) {
|
||||
var that = this;
|
||||
@ -67,10 +81,6 @@ $.widget( "ui.interaction", {
|
||||
_interactionStop: function( event, pointerPosition ) {
|
||||
this._stop( event, pointerPosition );
|
||||
interaction.started = false;
|
||||
},
|
||||
|
||||
_isValidTarget: function( target ) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@ -84,6 +94,7 @@ interaction.hooks.mouse = {
|
||||
setup: function( widget, start ) {
|
||||
widget._bind({
|
||||
"mousedown": function( event ) {
|
||||
// only react to the primary button
|
||||
if ( event.which === 1 ) {
|
||||
var started = start( event, event.target, {
|
||||
x: event.pageX,
|
||||
@ -91,6 +102,7 @@ interaction.hooks.mouse = {
|
||||
});
|
||||
|
||||
if ( started ) {
|
||||
// prevent selection
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user