Sha256: 33e1511d530592b9d298c836afca64acc985603607dd7608565585b1dc6f3ef6
Contents?: true
Size: 857 Bytes
Versions: 80
Compression:
Stored size: 857 Bytes
Contents
/** * Module dependencies. */ var matches = require('matches-selector') , event = require('event'); /** * Delegate event `type` to `selector` * and invoke `fn(e)`. A callback function * is returned which may be passed to `.unbind()`. * * @param {Element} el * @param {String} selector * @param {String} type * @param {Function} fn * @param {Boolean} capture * @return {Function} * @api public */ exports.bind = function(el, selector, type, fn, capture){ return event.bind(el, type, function(e){ if (matches(e.target, selector)) fn(e); }, capture); return callback; }; /** * Unbind event `type`'s callback `fn`. * * @param {Element} el * @param {String} type * @param {Function} fn * @param {Boolean} capture * @api public */ exports.unbind = function(el, type, fn, capture){ event.unbind(el, type, fn, capture); };
Version data entries
80 entries across 80 versions & 1 rubygems