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

Unified Diff: example/todomvc/web/editable_label.dart

Issue 22962005: Merge pull request #581 from kevmoo/polymer (Closed) Base URL: https://github.com/dart-lang/web-ui.git@polymer
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « example/todomvc/web/app.html ('k') | example/todomvc/web/editable_label.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 5239abae59a0b7a58648959b3dcce8bfdc3df4ba..8b6e279c34475ee5664f91dc8fcb1e3febe0a41b 100644
--- a/example/todomvc/web/editable_label.dart
+++ b/example/todomvc/web/editable_label.dart
@@ -5,7 +5,6 @@
library editable_label;
import 'dart:html';
-import 'dart:async';
import 'package:polymer/polymer.dart';
/**
@@ -17,34 +16,19 @@ class EditableLabel extends PolymerElement with ObservableMixin {
@observable String value = '';
bool get applyAuthorStyles => true;
- // TODO(jmesserly): replace this with allowing not-operator in templates.
- bool get notEditing => !editing;
-
InputElement get _editBox => getShadowRoot("editable-label").query('#edit');
- void created() {
- super.created();
-
- bindProperty(this, const Symbol('editing'),
- () => notifyProperty(this, const Symbol('notEditing')));
- }
-
void edit() {
editing = true;
// This causes _editBox to be inserted.
- Observable.dirtyCheck();
+ performMicrotaskCheckpoint();
- // 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;
- }));
+ // 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) {
« no previous file with comments | « example/todomvc/web/app.html ('k') | example/todomvc/web/editable_label.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698