chriswessels:hammer

v2.0.4_2Published 11 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

meteor-hammer

A smart-package for integrating with Hammer.js for multi-touch gestures. Bundles Hammer.js and provides Template.templateName.gestures() for easy use.

The interface for Template.templateName.gestures() is the same as Template.templateName.events().

##Example

1Template.yourTemplate.gestures({
2  'swipeleft .item .panel': function (event) {
3    /* Do something when user swipes left on .item .panel */
4  }
5});

##Installation

In your Meteor.js project directory, run

$ meteor add chriswessels:hammer

##Setting Hammer.js options

You can set Hammer.js options on a template level by using Template.templateName.hammerOptions(). It accepts a single argument, the options object to be passed to Hammer.js.

##Gesture Callback Function

The callback function you specify will be passed a single argument: the event object provided by Hammer.js.

The this context of the callback function will be set to the Blaze.TemplateInstance for your template.

##License

Please see the LICENSE file for more information.