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

Side by Side Diff: samples/third_party/todomvc_performance/web/elements/td_item.dart

Issue 1576153002: Remove the Dromaeo and TodoMVC samples. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
(Empty)
1 library todomvc.web.elements.td_item;
2
3 import 'dart:html';
4 import 'package:polymer/polymer.dart';
5 import 'td_model.dart';
6
7 @CustomTag('td-item')
8 class TodoItem extends LIElement with Polymer, Observable {
9 @published bool editing = false;
10 @published Todo item;
11
12 factory TodoItem() => new Element.tag('li', 'td-item');
13 TodoItem.created() : super.created() { polymerCreated(); }
14
15 editAction() {
16 editing = true;
17 // schedule focus for the end of microtask, when the input will be visible
18 async((_) => $['edit'].focus());
19 }
20
21 commitAction() {
22 if (editing) {
23 editing = false;
24 item.title = item.title.trim();
25 if (item.title == '') {
26 destroyAction();
27 }
28 fire('td-item-changed');
29 }
30 }
31
32 cancelAction() {
33 editing = false;
34 }
35
36 itemChangeAction() {
37 // TODO(jmesserly): asyncFire is needed because "click" fires before
38 // "item.checked" is updated on Firefox. Need to check Polymer.js.
39 asyncFire('td-item-changed');
40 }
41
42 destroyAction() {
43 fire('td-destroy-item', detail: item);
44 }
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698