transition-native.js revision ef982fe144b380cd6cd8dd1bc6ba74c7210033f9
794b79e6bbc3f5db1ea6ae154d739b9f1ef1a375Tinderbox User* Provides the transition method for Node.
bef75d63d74f58abc0f834ed271526672777ba29Automatic Updater* Transition has no API of its own, but adds the transition method to Node.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews* @module transition
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews* @requires node
bef75d63d74f58abc0f834ed271526672777ba29Automatic Updater TRANSITION_PROPERTY_CAMEL = 'WebkitTransition',
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews TRANSITION_PROPERTY = '-webkit-transition-property',
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews TRANSITION_DURATION = '-webkit-transition-duration',
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews TRANSITION_TIMING_FUNCTION = '-webkit-transition-timing-function',
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater * A class for constructing transition instances.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * Adds the "transition" method to Node.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * @class Transition
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * @constructor
e839bf134fb138920d4833cf05cb8b8906787a8dAutomatic Updater property = property.replace(/-([a-z])/gi, function(m0, m1) {
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {
aaaf8d4f4873d21e55c3ffb4f656203d08339865Mark AndrewsTransition._reKeywords = /^(?:node|duration|iterations|easing|delay)$/;
e839bf134fb138920d4833cf05cb8b8906787a8dAutomatic Updaterif (TRANSITION in Y.config.doc.documentElement.style) {
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater Transition.supported = true; // TODO: remove
795a316ec568b2470aab18b9481443966047652eAutomatic Updater node._transition = anim; // cache for reuse
795a316ec568b2470aab18b9481443966047652eAutomatic Updater config.duration: anim.constructor.DEFAULT_DURATION;
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater config.delay: anim.constructor.DEFAULT_DELAY;
0a7ed88633a680bb881868b75ded4d09a7bbbc50Automatic Updater anim._easing = config.easing || anim.constructor.DEFAULT_EASING;
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews anim._count = 0; // track number of animated properties
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews // might just be a value
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews // take control if another transition owns this property
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews if (attr && attr.transition && attr.transition !== anim) {
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews attr.transition._count--; // remapping attr to this transition
b27ce68bae92006e2ad7a9b75602c6385e529c3bAutomatic Updater duration: ((typeof config.duration !== 'undefined') ? config.duration :
922312472e2e05ebc64993d465999c5351b83036Automatic Updater anim._duration) || 0.0001, // make 0 async and fire events
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews delay: (typeof config.delay !== 'undefined') ? config.delay :
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews attrs = Transition._nodeAttrs[Y.stamp(anim._node)];
794b79e6bbc3f5db1ea6ae154d739b9f1ef1a375Tinderbox User if (config.transform && !config[TRANSFORM_CAMEL]) {
var anim = this;
return anim;
_start: function() {
this._runNative();
var anim = this,
attr,
name;
var anim = this,
data = {
if (callback) {
_onNativeEnd: function(e) {
var node = this,
if (anim) {
destroy: function() {
var anim = this;
* @param {Object} config An object containing one or more style properties, a duration and an easing.
* @param {Object} config An object containing one or more style properties, a duration and an easing.