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

Unified Diff: example/todomvc/web/editable_label.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « example/todomvc/web/app.dart ('k') | example/todomvc/web/index.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: example/todomvc/web/editable_label.dart
diff --git a/example/todomvc/web/editable_label.dart b/example/todomvc/web/editable_label.dart
index 3d72ed713d03da1e54ed53c8780355e5d2a20eef..5239abae59a0b7a58648959b3dcce8bfdc3df4ba 100644
--- a/example/todomvc/web/editable_label.dart
+++ b/example/todomvc/web/editable_label.dart
@@ -5,7 +5,7 @@
library editable_label;
import 'dart:html';
-import 'package:observe/observe.dart';
+import 'dart:async';
import 'package:polymer/polymer.dart';
/**
@@ -33,13 +33,18 @@ class EditableLabel extends PolymerElement with ObservableMixin {
editing = true;
// This causes _editBox to be inserted.
- deliverChangeRecords();
+ Observable.dirtyCheck();
- // For IE and Firefox: use .focus(), then reset the value to move the
- // cursor to the end.
- _editBox.focus();
- _editBox.value = '';
- _editBox.value = value;
+ // TODO(sigmund): remove the 2 runAsync calls. To do so, we might want to
+ // make dirtyCheck return a future or something to indicate that all
+ // change propagations are done.
+ runAsync(() => runAsync(() {
+ // For IE and Firefox: use .focus(), then reset the value to move the
+ // cursor to the end.
+ _editBox.focus();
+ _editBox.value = '';
+ _editBox.value = value;
+ }));
}
void update(Event e) {
@@ -55,3 +60,8 @@ class EditableLabel extends PolymerElement with ObservableMixin {
}
}
}
+
+@polymerInitMethod
+void _init() {
+ registerPolymerElement('editable-label', () => new EditableLabel());
+}
« no previous file with comments | « example/todomvc/web/app.dart ('k') | example/todomvc/web/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698