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

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: review comments, fixed build.dart 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
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..ab3f0b594e50522c84e3bf0893575cebd4d49051 100644
--- a/example/todomvc/web/editable_label.dart
+++ b/example/todomvc/web/editable_label.dart
@@ -5,13 +5,14 @@
library editable_label;
import 'dart:html';
-import 'package:observe/observe.dart';
+import 'dart:async';
import 'package:polymer/polymer.dart';
/**
* Label whose [value] can be edited by double clicking. When editing, it
* displays a form and input element, otherwise it displays the label.
*/
+@CustomTag('editable-label')
class EditableLabel extends PolymerElement with ObservableMixin {
@observable bool editing = false;
@observable String value = '';
@@ -33,13 +34,18 @@ class EditableLabel extends PolymerElement with ObservableMixin {
editing = true;
// This causes _editBox to be inserted.
- deliverChangeRecords();
-
- // For IE and Firefox: use .focus(), then reset the value to move the
- // cursor to the end.
- _editBox.focus();
- _editBox.value = '';
- _editBox.value = value;
+ Observable.dirtyCheck();
+
+ // 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) {

Powered by Google App Engine
This is Rietveld 408576698