From ef7ad8e345f5369409297a2832e4ba2d2ebc6651 Mon Sep 17 00:00:00 2001 From: Zack Brown Date: Sun, 25 May 2014 23:55:20 -0700 Subject: [PATCH] fix: make function-passing to fa-transform fields more reasonable 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. --- src/scripts/directives/fa-modifier.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scripts/directives/fa-modifier.js b/src/scripts/directives/fa-modifier.js index 411baaf8..24aa54bd 100644 --- a/src/scripts/directives/fa-modifier.js +++ b/src/scripts/directives/fa-modifier.js @@ -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)); } });