OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library todo_row; |
| 6 |
| 7 import 'package:polymer/polymer.dart'; |
| 8 import 'model.dart'; |
| 9 |
| 10 @CustomTag('todo-row') |
| 11 class TodoRow extends PolymerElement with ObservableMixin { |
| 12 @observable Todo todo; |
| 13 |
| 14 bool get applyAuthorStyles => true; |
| 15 |
| 16 // TODO(sigmund,terry): bring back scoped-css polyfills |
| 17 |
| 18 void created() { |
| 19 super.created(); |
| 20 var root = getShadowRoot("todo-row"); |
| 21 var label = root.query('#label').xtag; |
| 22 var item = root.query('.todo-item'); |
| 23 |
| 24 bindCssClass(item, 'completed', this, 'todo.done'); |
| 25 bindCssClass(item, 'editing', label, 'editing'); |
| 26 } |
| 27 |
| 28 void removeTodo() => appModel.todos.remove(todo); |
| 29 } |
OLD | NEW |