Skip to content

Commit

Permalink
fix: make function-passing to fa-transform fields more reasonable
Browse files Browse the repository at this point in the history
Previously, when a function was passed to a fa-modifier transform field
(like `fa-rotate`), `fa-modifier` expected that function to return a
full Transform array, while the most useful and expected case would be
to return the values approriate to that specific field (e.g.
for `fa-rotate="myFunc"`, `myFunc()` should reasonably return
an array [x, y, z].  Now this is the supported case.
  • Loading branch information
zackbrown committed May 26, 2014
1 parent b04cee8 commit ef7ad8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scripts/directives/fa-modifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ angular.module('famous.angular')
angular.forEach(_transformFields, function(field){
var candidate = _parsedTransforms[field] ? _parsedTransforms[field](scope) : undefined;
if(candidate !== undefined){
if(candidate instanceof Function) transforms.push(candidate())
else if(candidate instanceof Array) transforms.push(Transform[field].apply(this, candidate))
//TODO:feat Support Transitionables
if(candidate instanceof Function) candidate = candidate();
if(candidate instanceof Array) transforms.push(Transform[field].apply(this, candidate))
else transforms.push(Transform[field].call(this, candidate));
}
});
Expand Down

0 comments on commit ef7ad8e

Please # to comment.