Skip to content

Commit

Permalink
Fix after, before and behavior function when createAnimation via java…
Browse files Browse the repository at this point in the history
…script.
  • Loading branch information
darielnoel committed Mar 17, 2015
1 parent 4f07446 commit 1bc9a88
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/anijs.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
*/
createAnimation: function(aniJSParsedSentenceCollection, element) {
var nodeElement = element || '';

//BEAUTIFY: The params order migth be the same
selfish._setupElementAnim(nodeElement, aniJSParsedSentenceCollection);
},
Expand Down Expand Up @@ -384,10 +385,26 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
selfish._setupElementAnim = function(element, aniJSParsedSentenceCollection) {
var size = aniJSParsedSentenceCollection.length,
i = 0,
item;
item,
before,
after,
behavior;

for (i; i < size; i++) {
item = aniJSParsedSentenceCollection[i];
after = item.after;
before = item.before;
behavior = item.behavior;

if(after){
item.after = selfish.Parser.parseDoDefinition(after);
}
if(before){
item.before = selfish.Parser.parseDoDefinition(before);
}
if(behavior){
item.behavior = selfish.Parser.parseDoDefinition(behavior);
}
selfish._setupElementSentenceAnim(element, item);
}
};
Expand Down

0 comments on commit 1bc9a88

Please sign in to comment.