Skip to content

Commit

Permalink
feat: implement fa-properties on fa-surface; make ad hoc property dec…
Browse files Browse the repository at this point in the history
…laration more generic
  • Loading branch information
zackbrown committed Jun 13, 2014
1 parent 16842b2 commit 7c101d0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
22 changes: 18 additions & 4 deletions dist/famous-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -3200,11 +3200,25 @@ angular.module('famous.angular')
true
)


var _propToFaProp = function(prop){
return "fa" + prop.charAt(0).toUpperCase() + prop.slice(1);
};

isolate.getProperties = function(){
return {
backgroundColor: scope.$eval(attrs.faBackgroundColor),
color: scope.$eval(attrs.faColor)
};
var baseProperties = scope.$eval(attrs.faProperties) || {};
var properties = [
"backgroundColor",
"margin",
"padding",
"color"
];
for(var i = 0; i < properties.length; i++){
var prop = properties[i];
var faProp = _propToFaProp(prop);
if(attrs[faProp]) baseProperties[prop] = scope.$eval(attrs[faProp]);
}
return baseProperties;
};

isolate.renderNode = new Surface({
Expand Down
Loading

0 comments on commit 7c101d0

Please sign in to comment.