summaryrefslogtreecommitdiffstats
path: root/js/vendor/outlayer/item.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/vendor/outlayer/item.js')
-rw-r--r--js/vendor/outlayer/item.js29
1 files changed, 11 insertions, 18 deletions
diff --git a/js/vendor/outlayer/item.js b/js/vendor/outlayer/item.js
index e5f11f736..1aa792cf9 100644
--- a/js/vendor/outlayer/item.js
+++ b/js/vendor/outlayer/item.js
@@ -11,14 +11,11 @@
'ev-emitter/ev-emitter',
'get-size/get-size'
],
- function( EvEmitter, getSize ) {
- return factory( window, EvEmitter, getSize );
- }
+ factory
);
} else if ( typeof module == 'object' && module.exports ) {
// CommonJS - Browserify, Webpack
module.exports = factory(
- window,
require('ev-emitter'),
require('get-size')
);
@@ -26,13 +23,12 @@
// browser global
window.Outlayer = {};
window.Outlayer.Item = factory(
- window,
window.EvEmitter,
window.getSize
);
}
-}( window, function factory( window, EvEmitter, getSize ) {
+}( window, function factory( EvEmitter, getSize ) {
'use strict';
// ----- helpers ----- //
@@ -60,13 +56,13 @@ var transitionEndEvent = {
transition: 'transitionend'
}[ transitionProperty ];
-// cache all vendor properties
-var vendorProperties = [
- transformProperty,
- transitionProperty,
- transitionProperty + 'Duration',
- transitionProperty + 'Property'
-];
+// cache all vendor properties that could have vendor prefix
+var vendorProperties = {
+ transform: transformProperty,
+ transition: transitionProperty,
+ transitionDuration: transitionProperty + 'Duration',
+ transitionProperty: transitionProperty + 'Property'
+};
// -------------------------- Item -------------------------- //
@@ -280,7 +276,7 @@ proto._nonTransition = function( args ) {
* @param {Boolean} isCleaning - removes transition styles after transition
* @param {Function} onTransitionEnd - callback
*/
-proto._transition = function( args ) {
+proto.transition = function( args ) {
// redirect to nonTransition if no transition duration
if ( !parseFloat( this.layout.options.transitionDuration ) ) {
this._nonTransition( args );
@@ -326,8 +322,7 @@ function toDashedAll( str ) {
});
}
-var transitionProps = 'opacity,' +
- toDashedAll( vendorProperties.transform || 'transform' );
+var transitionProps = 'opacity,' + toDashedAll( transformProperty );
proto.enableTransition = function(/* style */) {
// HACK changing transitionProperty during a transition
@@ -354,8 +349,6 @@ proto.enableTransition = function(/* style */) {
this.element.addEventListener( transitionEndEvent, this, false );
};
-proto.transition = Item.prototype[ transitionProperty ? '_transition' : '_nonTransition' ];
-
// ----- events ----- //
proto.onwebkitTransitionEnd = function( event ) {