Sha256: 979550978c890e1042b05518e2eaf0bb288d9a5eacfa03bea78d50eec63092f9

Contents?: true

Size: 827 Bytes

Versions: 44

Compression:

Stored size: 827 Bytes

Contents

module.exports = {

  once: function(el, type, callback) {
    var typeArray = type.split(' ');
    var recursiveFunction = function(e){
      e.target.removeEventListener(e.type, recursiveFunction);
      return callback(e);
    };

    for (var i = typeArray.length - 1; i >= 0; i--) {
      this.on(el, typeArray[i], recursiveFunction);
    }
  },

  // IE8+ Support
  on: function(el, type, callback) {
    if(el.addEventListener) {
      el.addEventListener(type, callback);
    } else {
      el.attachEvent('on' + type, function() {
        callback.call(el);
      });
    }
  },

  // IE8+ Support
  off: function(el, type, callback) {
    if(el.removeEventListener) {
      el.removeEventListener(type, callback);
    } else {
      el.detachEvent('on' + type, callback);
    }
  }
};

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
nutella_framework-0.6.4 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.6.3 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.6.2 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.6.1 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.6.0 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.5.1 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.5.0 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.32 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.31 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.30 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.29 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.28 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.27 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.26 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.25 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.24 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.23 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.22 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.21 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js
nutella_framework-0.4.20 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js