Chromium Code Reviews| Index: sky/framework/fn.dart |
| diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart |
| index 73d13547325c5c22dcfff870c8632e187183c7f4..0dc59513893fdc06f316427cbf42bb8969e49626 100644 |
| --- a/sky/framework/fn.dart |
| +++ b/sky/framework/fn.dart |
| @@ -135,17 +135,22 @@ abstract class Element extends Node { |
| String inlineStyle; |
| List<Node> _children = null; |
| - String _className = ''; |
| + String _class = ''; |
| Element({ |
| Object key, |
| List<Node> children, |
| - Style style, |
| + List<Style> styles, |
| this.inlineStyle |
| }) : super(key:key) { |
| + _class = ''; |
|
rafaelw
2015/03/11 21:17:15
bit:
_class = styles == null ? '' : styles.map((s
abarth-chromium
2015/03/11 21:20:05
Done.
|
| + if (styles != null) { |
| + for (Style style in styles) { |
| + _class += ' ' + style._className; |
| + } |
| + } |
| - _className = style == null ? '': style._className; |
| _children = children == null ? _emptyList : children; |
| if (_isInCheckedMode) { |
| @@ -229,8 +234,8 @@ abstract class Element extends Node { |
| _syncEvents(old); |
| sky.Element root = _root as sky.Element; |
| - if (_className != old._className) { |
| - root.setAttribute('class', _className); |
| + if (_class != old._class) { |
| + root.setAttribute('class', _class); |
| } |
| if (inlineStyle != old.inlineStyle) { |
| @@ -413,12 +418,12 @@ class Container extends Element { |
| Container({ |
| Object key, |
| List<Node> children, |
| - Style style, |
| + List<Style> styles, |
| String inlineStyle |
| }) : super( |
| key: key, |
| children: children, |
| - style: style, |
| + styles: styles, |
| inlineStyle: inlineStyle |
| ); |
| } |
| @@ -437,7 +442,7 @@ class Image extends Element { |
| Image({ |
| Object key, |
| List<Node> children, |
| - Style style, |
| + List<Style> styles, |
| String inlineStyle, |
| this.width, |
| this.height, |
| @@ -445,7 +450,7 @@ class Image extends Element { |
| }) : super( |
| key: key, |
| children: children, |
| - style: style, |
| + styles: styles, |
| inlineStyle: inlineStyle |
| ); |
| @@ -481,7 +486,7 @@ class Anchor extends Element { |
| Anchor({ |
| Object key, |
| List<Node> children, |
| - Style style, |
| + List<Style> styles, |
| String inlineStyle, |
| this.width, |
| this.height, |
| @@ -489,7 +494,7 @@ class Anchor extends Element { |
| }) : super( |
| key: key, |
| children: children, |
| - style: style, |
| + styles: styles, |
| inlineStyle: inlineStyle |
| ); |