Permalink
Browse files

Working

  • Loading branch information...
1 parent 923b8eb commit 940b8f63b1b9c58bce8e8282047f145462199e2f @mcfedr committed Sep 1, 2011
Showing with 42 additions and 38 deletions.
  1. +42 −38 Source/Fx/Fx.Elements.CSS3.js
@@ -13,48 +13,52 @@ requires: [Core/Fx.CSS3Funcs, Core/Fx.Morph, Fx.Elements]
provides: [Fx.Elements.CSS3]
...
*/
+(function() {
+
+ var elementsCSS2 = Fx.Elements;
-var elementsCSS2 = Fx.Elements;
+ Fx.Elements = new Class({
+ Extends: elementsCSS2,
-Fx.Elements = new Class({
- Extends: elementsCSS2,
-
- 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) {
+ check: function(obj){
+ return (this.css3Supported && !this.boundComplete && Object.every(obj, function(properties, key) {
if(properties && this.elements[key]) {
- new Fx.Morph(this.elements[key], Object.merge({}, this.options, {
- onComplete: complete
- })).start(properties);
+ return this.animatable().containsArray(Object.keys(properties));
}
- }, this);
-
- this.fireEvent('start', this);
- return this;
+ 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]) {
+ 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.