transition-debug.js revision f0d88feb1b7e3a775e0e9c8648faf84a32250546
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater* Provides the transition method for Node.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews* Transition has no API of its own, but adds the transition method to Node.
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater* @module transition
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews* @requires node-style
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews TRANSITION_PROPERTY_CAMEL = 'WebkitTransitionProperty',
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews TRANSITION_PROPERTY = '-webkit-transition-property',
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews TRANSITION_DURATION = '-webkit-transition-duration',
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater TRANSITION_TIMING_FUNCTION = '-webkit-transition-timing-function',
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater TRANSITION_DELAY = '-webkit-transition-delay',
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * A class for constructing transition instances.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * Adds the "transition" method to Node.
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * @class Transition
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews * @constructor
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews 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) {
b272d38cc5d24f64c0647a9afb340c21c4b9aaf7Evan HuntTransition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrewsif (TRANSITION in Y.config.doc.documentElement.style) {
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews config.duration: anim.constructor.DEFAULT_DURATION;
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews 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
setTimeout(function() {
var anim = this,
var attr,
var anim = this,
data = {
return anim;
_start: function() {
this._runNative();
var anim = this,
attr,
name;
var anim = this,
data = {
if (node) {
if (callback) {
} else if (callback) {
_onNativeEnd: function(e) {
var node = this,
data,
if (anim) {
data = {
destroy: function() {
var anim = this;
* @param {Object} config An object containing one or more style properties, a duration and an easing.
prop;
config = null;
if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default
else if (name && !Y.Transition) { Y.log('unable to transition show; missing transition module', 'warn', 'node'); }
if (fn) {
if (callback) {
config = null;
if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default
} else if (name && !Y.Transition) { Y.log('unable to transition hide; missing transition module', 'warn', 'node'); // end if on nex
this._hide();
* @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
node;
if (on) {
this._show();
node;
fadeOut: {
fadeIn: {
sizeOut: {
sizeIn: {
on: {
start: function() {
end: function() {
_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,
data,
name,
t = time;
data = {
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: {
if (node) {
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,