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

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, 4 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
« no previous file with comments | « example/todomvc/web/router_options.dart ('k') | lib/boot.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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';
8 import 'package:polymer/polymer.dart'; 7 import 'package:polymer/polymer.dart';
9 import 'model.dart'; 8 import 'model.dart';
10 9
10 @CustomTag('todo-row')
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");
16 15
17 created() { 16 // TODO(sigmund,terry): bring back scoped-css polyfills
17
18 void 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 }
OLDNEW
« no previous file with comments | « example/todomvc/web/router_options.dart ('k') | lib/boot.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698