Sha256: be9e299d2a818b5e5b9a2a802d075614f51aa4ea4e75a40577ff19f7bac298ba

Contents?: true

Size: 764 Bytes

Versions: 21

Compression:

Stored size: 764 Bytes

Contents

/**
 * Bind `el` event `type` to `fn`.
 *
 * @param {Element} el
 * @param {String} type
 * @param {Function} fn
 * @param {Boolean} capture
 * @return {Function}
 * @api public
 */

exports.bind = function(el, type, fn, capture){
  if (el.addEventListener) {
    el.addEventListener(type, fn, capture);
  } else {
    el.attachEvent('on' + type, fn);
  }
  return fn;
};

/**
 * Unbind `el` event `type`'s callback `fn`.
 *
 * @param {Element} el
 * @param {String} type
 * @param {Function} fn
 * @param {Boolean} capture
 * @return {Function}
 * @api public
 */

exports.unbind = function(el, type, fn, capture){
  if (el.removeEventListener) {
    el.removeEventListener(type, fn, capture);
  } else {
    el.detachEvent('on' + type, fn);
  }
  return fn;
};

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ende-0.5.22 components/component/event/0.1.0/index.js
ende-0.5.21 components/component/event/0.1.0/index.js
ende-0.5.20 components/component/event/0.1.0/index.js
ende-0.5.19 components/component/event/0.1.0/index.js
ende-0.5.18 components/component/event/0.1.0/index.js
ende-0.5.17 components/component/event/0.1.0/index.js
ende-0.5.16 components/component/event/0.1.0/index.js
ende-0.5.15 components/component/event/0.1.0/index.js
ende-0.5.14 components/component/event/0.1.0/index.js
ende-0.5.13 components/component/event/0.1.0/index.js
ende-0.5.12 components/component/event/0.1.0/index.js
ende-0.5.10 components/component/event/0.1.0/index.js
ende-0.5.9 components/component/event/0.1.0/index.js
ende-0.5.8 components/component/event/0.1.0/index.js
ende-0.5.7 components/component/event/0.1.0/index.js
ende-0.5.6 components/component/event/0.1.0/index.js
ende-0.5.5 components/component/event/0.1.0/index.js
ende-0.5.4 components/component/event/0.1.0/index.js
ende-0.5.3 components/component/event/0.1.0/index.js
ende-0.5.2 components/component/event/0.1.0/index.js