Permalink
Browse files

Fixes #424, Fx.Elements should not try to set styles of non-existing …

…elements.
  • Loading branch information...
1 parent decdf89 commit 1fd7566ecf22c9f4f2aed94873c6411d217f128e @timwienk timwienk committed Oct 26, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 Source/Fx/Fx.Elements.js
View
10 Source/Fx/Fx.Elements.js
@@ -32,32 +32,42 @@ Fx.Elements = new Class({
compute: function(from, to, delta){
var now = {};
+
for (var i in from){
var iFrom = from[i], iTo = to[i], iNow = now[i] = {};
for (var p in iFrom) iNow[p] = this.parent(iFrom[p], iTo[p], delta);
}
+
return now;
},
set: function(now){
for (var i in now){
+ if (!this.elements[i]) continue;
+
var iNow = now[i];
for (var p in iNow) this.render(this.elements[i], p, iNow[p], this.options.unit);
}
+
return this;
},
start: function(obj){
if (!this.check(obj)) return this;
var from = {}, to = {};
+
for (var i in obj){
+ if (!this.elements[i]) continue;
+
var iProps = obj[i], iFrom = from[i] = {}, iTo = to[i] = {};
+
for (var p in iProps){
var parsed = this.prepare(this.elements[i], p, iProps[p]);
iFrom[p] = parsed.from;
iTo[p] = parsed.to;
}
}
+
return this.parent(from, to);
}

0 comments on commit 1fd7566

Please sign in to comment.