Interaction


type: utility

release: 0.0

status: in development

documentation: N/A

demo: http://view.jqueryui.com/interactions/demos/interaction/default.html

 

TODOs

 

iOS Developer Library - Handling Events

 

 


 

1 - Description:

 

This utility is a base for building interactions. Interactions all have in common a 3-part event model: start -> move(s) -> stop. This interaction base serves as an abstraction layer for events from any input device that allows for movement with such an event model, or anything that could be mapped to such a model. Examples are drag-and-drop (mouse), swipe/slide (touch), etc.

 

There is built-in support for mouse and touch events on both desktop and mobile browsers. There is also an extension mechanism (called interaction hooks) such that the base can be extended to support input from any device that can trigger the start, multiple moves, and a stop. This would bring that same support to any interaction that builds on top of the interaction base, meaning each of those interactions does not need specific knowledge of each device and its API.

 


 

2 - Visual Design:

 

N/A

 


 

 

3 - Functional Specification:

 

The interaction utility is not designed to be used standalone, but as an extension base for interactions. Such an extension must provide implementations for at least _start, _move, and _stop. For example:

 

$.widget( "demo.simple", $.ui.interaction, {

     _start: function( event, position ) {

          //

     },

     _move: function( event, position ) {

          //

     },

     _stop: function( event, position ) {

          //

     }

});

 

In addition to being able to create an interaction by extending interaction as a base, the interaction base can also be extended to support input devices other than mouse and touch (for which support is built-in). This is accomplished by the interaction hooks (see below in this section).

 

Note: The interaction hooks supports arbitrary event models. As such, plugins that build on top of interaction should not attempt to read any properties from the events that are passed to _start(), _move(), and _stop(). All logic should be implemented based on the pointer position.

 

Options:

 

Methods:

 

Events:

 

Abstract Methods (to be provided by widget that extends ui.interaction):

 

Interaction Hooks:

 


 

4 - Markup & Style:

 

N/A

 


 

5 - Latest version of plugin:

http://view.jqueryui.com/interactions/demos/interaction/default.html

 


 

 

6 - Open issues being discussed

 

(Use this area to place things that we're hashing out like features and options we're not sure we should include, questions about how this fits into UI and relates to other widgets and utilities, known problems, whether features should be broken across multiple releases, etc.)