transition-debug.js revision 59171f95d68f00afaea1a329e4a463e2cb75bec0
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User* Provides the transition method for Node.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User* Transition has no API of its own, but adds the transition method to Node.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User* @module transition
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User * A class for constructing transition instances.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User * Adds the "transition" method to Node.
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User * @class Transition
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User * @constructor
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User TRANSITION_PROPERTY_CAMEL = 'WebkitTransition',
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User TRANSITION_PROPERTY = '-webkit-transition-property',
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User TRANSITION_DURATION = '-webkit-transition-duration',
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User TRANSITION_TIMING_FUNCTION = '-webkit-transition-timing-function',
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User TRANSITION_DELAY = '-webkit-transition-delay',
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User property = property.replace(/-([a-z])/gi, function(m0, m1) {
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox UserTransition._reKeywords = /^(?:node|duration|iterations|easing|delay)$/;
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox Userif (TRANSITION in Y.config.doc.documentElement.style) {
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User config.duration: anim.constructor.DEFAULT_DURATION;
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User config.delay: anim.constructor.DEFAULT_DELAY;
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User anim._easing = config.easing || anim.constructor.DEFAULT_EASING;
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User anim._count = 0; // track number of animated properties
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User // might just be a value
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User // take control if another transition owns this property
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User if (attr && attr.transition && attr.transition !== anim) {
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User attr.transition._count--; // remapping attr to this transition
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User duration: ((typeof config.duration !== 'undefined') ? config.duration :
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User anim._duration) || 0.0001, // make 0 async and fire events
1e9517ea2156b990be21f44676d3370318eacf17Tinderbox User delay: (typeof config.delay !== 'undefined') ? config.delay :
var anim = this,
var attr;
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.
* @param {Function} callback A function to run after the transition has completed. The callback fires
_start: function() {
this._runNative();
this._runTimer();
_runTimer: function() {
var anim = this;
_endTimer: function() {
var anim = this;
_runFrame: function() {
var t = new Date() - this._startTime;
this._runAttrs(t);
var anim = this,
done = false,
allDone = false,
name,
t = time;
done = (t >= d);
if (done) {
allDone = true;
_initAttrs: function() {
var anim = this,
val,
name,
mTo,
destroy: function() {
this.detachAll();
this._node = null;
_runtimeAttrs: {},
behaviors: {
left: {
return val;
_startTimer: function() {
_stopTimer: function() {
_runFrame: function() {
var done = true,
anim;
done = false;
if (done) {
cubicBezier: function(p, t) {
D = x0,
H = y0,
easings: {
_running: {},
_timer: null,