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.7.3 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.7.2 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.7.1 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.7.0 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.21 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.20 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.19 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.18 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.17 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.16 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.15 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.13 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.12 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.11 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.10 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.9 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.8 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.7 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.6 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js
nutella_framework-0.6.5 framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js