Skip to content

Commit

Permalink
Working
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfedr committed Sep 1, 2011
1 parent 923b8eb commit 940b8f6
Showing 1 changed file with 42 additions and 38 deletions.
80 changes: 42 additions & 38 deletions Source/Fx/Fx.Elements.CSS3.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,48 +13,52 @@ requires: [Core/Fx.CSS3Funcs, Core/Fx.Morph, Fx.Elements]
provides: [Fx.Elements.CSS3] provides: [Fx.Elements.CSS3]
... ...
*/ */
(function() {

var elementsCSS2 = Fx.Elements;


var elementsCSS2 = Fx.Elements; Fx.Elements = new Class({
Extends: elementsCSS2,


Fx.Elements = new Class({ check: function(obj){
Extends: elementsCSS2, return (this.css3Supported && !this.boundComplete && Object.every(obj, function(properties, key) {

check: function(obj){
return (this.css3Supported && !this.boundComplete && Object.every(obj, function(properties, key) {
if(properties && this.elements[key]) {
return this.animatable().containsArray(Object.keys(properties));
}
return true;
}, this)) || this.parent();
},

start: function(obj){
if (this.css3Supported){
if (!this.check(obj)) return this;

var count = 0;
var complete = function() {
if(count-- == 0) {
this.fireEvent('complete', this);
}
}.bind(this);

Object.each(obj, function(properties, key) {
if(properties && this.elements[key]) { if(properties && this.elements[key]) {
new Fx.Morph(this.elements[key], Object.merge({}, this.options, { return this.animatable().containsArray(Object.keys(properties));
onComplete: complete
})).start(properties);
} }
}, this); return true;

}, this)) || this.parent();
this.fireEvent('start', this); },
return this;
start: function(obj){
if (this.css3Supported){
if (!this.check(obj)) return this;

var count = 0;
var complete = function() {
if(count-- == 0) {
this.fireEvent('complete', this);
}
}.bind(this);

Object.each(obj, function(properties, key) {
if(properties && this.elements[key]) {
count++;
new Fx.Morph(this.elements[key], Object.merge({}, this.options, {
onComplete: complete
})).start(properties);
}
}, this);

this.fireEvent('start', this);
return this;
}
return this.parent(obj);
} }
return this.parent(properties); });
}
}); Fx.Elements.implement(Fx.CSS3Funcs);


Fx.Elements.implement(Fx.CSS3Funcs); Fx.Elements.CSS2 = elementsCSS2;
Fx.Elements.CSS3 = Fx.Elements;


Fx.Elements.CSS2 = elementsCSS2; })();
Fx.Elements.CSS3 = Fx.Elements;

0 comments on commit 940b8f6

Please sign in to comment.