Sha256: 84303c0dd5c03e87516a23360ca81263f492236911fcaab706c9bd52d426ab22
Contents?: true
Size: 1.1 KB
Versions: 4
Compression:
Stored size: 1.1 KB
Contents
/* * special event API with Hammer.JS * version 0.9 * author: Damien Antipa * https://github.com/dantipa/hammer.js */ (function ($) { var hammerEvents = ['hold','tap','doubletap','transformstart','transform','transformend','dragstart','drag','dragend','swipe','release']; $.each(hammerEvents, function(i, event) { $.event.special[event] = { setup: function(data, namespaces, eventHandle) { var $target = $(this), hammer; if (!$target.hammer) { $target.data('hammerjs', new Hammer(this, data)); } hammer = $target.data('hammerjs'); hammer['on'+ event] = function (ev) { $target.trigger($.Event(event, ev)); }; }, teardown: function(namespaces) { var $target = $(this), hammer = $target.data('hammerjs'); if(hammer && hammer['on'+ event]) { delete hammer['on'+ event]; } } }; }); }(jQuery));
Version data entries
4 entries across 4 versions & 1 rubygems