transition-native.js revision faaae38be4a20dfe177f4487e919fbf7a69b8cc8
/**
* Provides the transition method for Node.
*
* @module node
* @submodule transition
*/
/*
* A class for constructing transition instances.
* Adds the "transition" method to Node.
* @class Transition
* @constructor
* @see Node
*/
var TRANSITION = '-webkit-transition',
TRANSITION_PROPERTY_CAMEL = 'WebkitTransition',
TRANSITION_PROPERTY = '-webkit-transition-property',
TRANSITION_DURATION = '-webkit-transition-duration',
TRANSITION_TIMING_FUNCTION = '-webkit-transition-timing-function',
TRANSITION_DELAY = '-webkit-transition-delay',
TRANSITION_END = 'webkitTransitionEnd',
TRANSFORM_CAMEL = 'WebkitTransform',
EMPTY_OBJ = {},
Transition = function() {
};
return m1.toUpperCase();
});
return property;
};
var str = '';
if (m1) {
}
if (m3) {
}
return str;
});
return property;
};
Transition.useNative = false;
Transition.useNative = true;
}
Transition._nodeAttrs = {};
Transition.prototype = {
var anim = this;
}
return anim;
},
var anim = this,
attr,
val;
if (!attrs) {
}
// might just be a value
}
if (typeof val === 'function') {
}
// take control if another transition owns this property
}
};
},
removeProperty: function(prop) {
var anim = this,
}
},
var attr;
}
}
}
},
/*
* Starts or an animation.
* @method run
* @chainable
*/
var anim = this;
type: 'transition:start',
});
}
return anim;
},
_start: function() {
this._runNative();
},
return dur + 's';
},
_runNative: function(time) {
var anim = this,
cssText = '',
attr,
name;
// preserve existing transitions
if (cssTransition !== 'all') {
}
// run transitions mapped to this instance
} else {
this.removeProperty(name);
}
}
}
// only one native end event per node
if (!node._hasTransitionEnd) {
node._hasTransitionEnd = true;
}
},
var anim = this,
data = {
type: 'transition:end',
};
if (callback) {
setTimeout(function() { // IE: allow previous update to finish
}, 1);
}
},
_endNative: function(name) {
if (typeof value === 'string') {
}
},
_onNativeEnd: function(e) {
var node = this,
if (anim) {
type: 'propertyEnd',
});
}
}
},
destroy: function() {
var anim = this;
}
}
};
Y.Transition = Transition;
/**
* Animate one or more css properties to a given value. Requires the "transition" module.
* <pre>example usage:
* Y.one('#demo').transition({
* duration: 1, // in seconds, default is 0.5
* easing: 'ease-out', // default is 'ease'
* height: '10px',
* width: '10px',
* delay: '1', // delay start for 1 second, default is 0
* opacity: { // per property
* value: 0,
* duration: 2,
* delay: 2,
* easing: 'ease-in'
* }
* });
* </pre>
* @for Node
* @method transition
* @param {Object} config An object containing one or more style properties, a duration and an easing.
* @param {Function} callback A function to run after the transition has completed.
* @chainable
*/
var anim = this._transition;
} else {
}
return this;
};
/**
* Animate one or more css properties to a given value. Requires the "transition" module.
* <pre>example usage:
* Y.all('.demo').transition({
* duration: 1, // in seconds, default is 0.5
* easing: 'ease-out', // default is 'ease'
* height: '10px',
* width: '10px',
* delay: '1', // delay start for 1 second, default is 0
* opacity: { // per property
* value: 0,
* duration: 2,
* delay: 2,
* easing: 'ease-in'
* }
* });
* </pre>
* @for NodeList
* @method transition
* @param {Object} config An object containing one or more style properties, a duration and an easing.
* @param {Function} callback A function to run after the transition has completed. The callback fires
* once per item in the NodeList.
* @chainable
*/
});
return this;
};