backbone-input / touch

Seamless touch integration for backbone views

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backbone Input: Touch

Enables Backbone views with fast tap and swipe events on touch devices.

The plugin is made to work with your existing views. It replaces the delegateEvents method and replaces any click event with the three events touchstart, touchmove and touchend when a touch device is used. Once the touchend fires your callback is executed without the 300ms delay that the click event has.

Examples

Features

  • Addresses the 300ms delay
  • Uses FastClick if available
  • Multi-touch monitoring
  • One finger swipes
  • AMD/CommonJS module

Dependencies

Install

Using Bower

bower install backbone.input.touch`

Manual download

Usage

Note that this extension currently overwrites Backbone.View but its features are behing an option flag, to limit its usage only when needed.

After all dependencies (an plugin) are loaded, simply include touch in your monitor array:

var view = new Backbone.View({
	options: {
		monitor: ["touch"]
	}
});

Credits

Initiated by Makis Tracend ( @tracend )

Distributed through Makesites.org

Originally based on Backbone.Touch

License

Released under the MIT License

About

Seamless touch integration for backbone views


Languages

Language:JavaScript 89.5%Language:HTML 10.5%