| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library todo_row; | 5 library todo_row; |
| 6 | 6 |
| 7 import 'package:observe/observe.dart'; | 7 import 'package:observe/observe.dart'; |
| 8 import 'package:polymer/polymer.dart'; | 8 import 'package:polymer/polymer.dart'; |
| 9 import 'model.dart'; | 9 import 'model.dart'; |
| 10 | 10 |
| 11 class TodoRow extends PolymerElement with ObservableMixin { | 11 class TodoRow extends PolymerElement with ObservableMixin { |
| 12 @observable Todo todo; | 12 @observable Todo todo; |
| 13 | 13 |
| 14 bool get applyAuthorStyles => true; |
| 14 ScopedCssMapper get css => getScopedCss("todo-row"); | 15 ScopedCssMapper get css => getScopedCss("todo-row"); |
| 15 | 16 |
| 16 created() { | 17 created() { |
| 17 super.created(); | 18 super.created(); |
| 18 var root = getShadowRoot("todo-row"); | 19 var root = getShadowRoot("todo-row"); |
| 19 var label = root.query('#label').xtag; | 20 var label = root.query('#label').xtag; |
| 20 var item = root.query('.' + css['.todo-item']); | 21 var item = root.query('.' + css['.todo-item']); |
| 21 | 22 |
| 22 bindCssClass(item, css['.completed'], this, 'todo.done'); | 23 bindCssClass(item, css['.completed'], this, 'todo.done'); |
| 23 bindCssClass(item, css['.editing'], label, 'editing'); | 24 bindCssClass(item, css['.editing'], label, 'editing'); |
| 24 } | 25 } |
| 25 | 26 |
| 26 void removeTodo() => appModel.todos.remove(todo); | 27 void removeTodo() => appModel.todos.remove(todo); |
| 27 } | 28 } |
| OLD | NEW |