transition-debug.js revision 4632cdc3e0dcbe25d3f88f78717d77b2c0edfd55
/**
* The Native Transition Utility provides an API wrapper for CSS transitions.
* It is also the base module for the timer-based transition module.
* @module transition
*/
/**
* Provides the base Transition class. The "transition" method is added to Node,
* and is how Transition should be used.
*
* @module transition
* @submodule transition-native
*/
/**
* A class for constructing transition instances.
* Adds the "transition" method to Node.
* @class Transition
* @see Node
* @constructor
*/
var TRANSITION = '-webkit-transition',
TRANSITION_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',
Transition = function() {
};
Transition.useNative = false;
Transition.useNative = true;
}
Transition._nodeAttrs = {};
Transition.prototype = {
var anim = this;
}
return anim;
},
var anim = this,
val,
attr;
if (!attrs) {
}
}
} else {
}
}
if (typeof val === 'function') {
}
if (!duration) { // make async and fire events
duration = 0.00001;
}
};
}
}
},
/**
* 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
}
}
// 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() {
}
},
_onNativeEnd: function(e) {
var node = this,
if (anim) {
Transition._count--;
type: 'propertyEnd',
});
anim._endNative();
}
}
},
destroy: function() {
this.detachAll();
this._node = null;
}
};
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, // seconds
easing: 'ease-out',
height: '10px',
width: '10px',
value: 0,
duration: 2,
easing: 'ease-in'
}
});
</pre>
@for Node
@method transition
@param {Object} An object containing one or more style properties, a duration and an easing.
@chainable
*/
var anim = this._transition;
} else {
}
return this;
};
/**
* The Transition Utility provides an API for creating advanced transitions.
* @module transition
*/
/**
* Provides the base Transition class, for animating numeric properties.
*
* @module transition
* @submodule transition-timer
*/
var PROPERTY_END = 'transition:propertyEnd',
Transition = Y.Transition;
_start: function() {
if (Transition.useNative) {
this._runNative();
} else {
this._runTimer();
}
},
_runTimer: function() {
var anim = this;
anim._initAttrs();
anim._startTime = new Date();
},
_endTimer: function() {
var anim = this;
anim._startTime = null;
},
_runFrame: function() {
var t = new Date() - this._startTime;
this._runAttrs(t);
},
var anim = this,
done = false,
allDone = false,
name,
d,
t,
i;
t = time;
done = (t >= d);
if (t > d) {
t = d;
}
if (done) {
type: 'propertyEnd',
});
allDone = true;
}
}
}
}
}
},
_initAttrs: function() {
var anim = this,
val,
name,
}
return;
}
if (typeof easing === 'string') {
}
}
}
}
},
destroy: function() {
this.detachAll();
this._node = null;
}
}, true);
Y.mix(Y.Transition, {
_runtimeAttrs: {},
/**
* Regex of properties that should use the default unit.
*
* @property RE_DEFAULT_UNIT
* @static
*/
/**
* The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
*
* @property DEFAULT_UNIT
* @static
*/
DEFAULT_UNIT: 'px',
/**
* Time in milliseconds passed to setInterval for frame processing
*
* @property intervalTime
* @default 20
* @static
*/
intervalTime: 20,
/**
* Bucket for custom getters and setters
*
* @property behaviors
* @static
*/
behaviors: {
left: {
}
}
},
/**
* The default setter to use when setting object properties.
*
* @property DEFAULT_SETTER
* @static
*/
} else {
}
},
/**
* The default getter to use when getting object properties.
*
* @property DEFAULT_GETTER
* @static
*/
val = '';
} else {
}
return val;
},
_startTimer: function() {
if (!Transition._timer) {
}
},
_stopTimer: function() {
Transition._timer = null;
},
/**
* Called per Interval to handle each animation frame.
* @method _runFrame
* @private
* @static
*/
_runFrame: function() {
var done = true,
anim;
done = false;
}
}
if (done) {
}
},
cubicBezier: function(p, t) {
var x0 = 0,
y0 = 0,
x1 = p[0],
y1 = p[1],
x2 = p[2],
y2 = p[3],
x3 = 1,
y3 = 0,
D = x0,
H = y0,
x = (((A*t) + B)*t + C)*t + D,
y = (((E*t) + F)*t + G)*t + H;
return [x, y];
},
easings: {
'ease-in': [0.42, 0, 1, 1],
'ease-out': [0, 0, 0.58, 1],
'ease-in-out': [0.42, 0, 0.58, 1]
},
_running: {},
_timer: null,
}, true);
Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left;
Y.Transition = Transition;