| OLD | NEW |
| (Empty) |
| 1 library todomvc.web.elements.td_input; | |
| 2 | |
| 3 import 'dart:html'; | |
| 4 import 'package:polymer/polymer.dart'; | |
| 5 | |
| 6 @CustomTag('td-input') | |
| 7 class TodoInput extends InputElement with Polymer, Observable { | |
| 8 factory TodoInput() => new Element.tag('input', 'td-input'); | |
| 9 TodoInput.created() : super.created() { polymerCreated(); } | |
| 10 | |
| 11 keypressAction(e) { | |
| 12 // Listen for enter on keypress but esc on keyup, because | |
| 13 // IE doesn't fire keyup for enter. | |
| 14 if (e.keyCode == KeyCode.ENTER) { | |
| 15 fire('td-input-commit'); | |
| 16 } | |
| 17 } | |
| 18 | |
| 19 keyupAction(e) { | |
| 20 if (e.keyCode == KeyCode.ESC) { | |
| 21 fire('td-input-cancel'); | |
| 22 } | |
| 23 } | |
| 24 } | |
| OLD | NEW |