Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: example/todomvc/web/todo_row.dart

Issue 20863002: Introduce boot.js: this finally makes it possible to load and run Todomvc (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 bool get applyAuthorStyles => true;
15 ScopedCssMapper get css => getScopedCss("todo-row"); 15
16 // TODO(sigmund,terry): bring back scoped-css polyfills
16 17
17 created() { 18 created() {
18 super.created(); 19 super.created();
19 var root = getShadowRoot("todo-row"); 20 var root = getShadowRoot("todo-row");
20 var label = root.query('#label').xtag; 21 var label = root.query('#label').xtag;
21 var item = root.query('.' + css['.todo-item']); 22 var item = root.query('.todo-item');
22 23
23 bindCssClass(item, css['.completed'], this, 'todo.done'); 24 bindCssClass(item, 'completed', this, 'todo.done');
24 bindCssClass(item, css['.editing'], label, 'editing'); 25 bindCssClass(item, 'editing', label, 'editing');
25 } 26 }
26 27
27 void removeTodo() => appModel.todos.remove(todo); 28 void removeTodo() => appModel.todos.remove(todo);
28 } 29 }
30
31 _init() {
32 registerPolymerElement('todo-row', () => new TodoRow());
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698