Sha256: a615f12e813770a02b9dfa754669b9e7c0eeba35f2e5fad867cc586576c85ed0

Contents?: true

Size: 1.24 KB

Versions: 44

Compression:

Stored size: 1.24 KB

Contents

var Events = require('./events');

module.exports = {

  _testSupportedProps: function(props) {
    var i,
      undefined,
      el = document.createElement('div');

    for (i in props) {
      if (props.hasOwnProperty(i) && el.style[i] !== undefined) {
        return props[i];
      }
    }
  },

  //Returns the correct event name to use
  transitionEndEventName: function() {
    return this._testSupportedProps({
      'transition':'transitionend',
      'OTransition':'otransitionend',  
      'MozTransition':'transitionend',
      'WebkitTransition':'webkitTransitionEnd'
    });
  },

  animationEndEventName: function() {
    return this._testSupportedProps({
      'animation': 'animationend',
      '-o-animation': 'oAnimationEnd',
      '-moz-animation': 'animationend',
      '-webkit-animation': 'webkitAnimationEnd'
    });
  },

  onTransitionEnd: function (el, callback) {
    var transitionEnd = this.transitionEndEventName();

    Events.once(el, transitionEnd, function() {
      return callback();
    });
  },

  onAnimationEnd: function (el, callback) {
    var animationEnd = this.animationEndEventName();

    Events.once(el, animationEnd, function() {
      return 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/css-event.js
nutella_framework-0.6.3 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.2 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.1 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.0 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.5.1 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.5.0 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.32 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.31 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.30 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.29 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.28 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.27 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.26 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.25 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.24 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.23 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.22 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.21 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.4.20 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js