OLD | NEW |
1 <!-- | 1 <!-- |
2 // Copyright 2015 The Chromium Authors. All rights reserved. | 2 // Copyright 2015 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 --> | 5 --> |
6 <import src="/sky/framework/shell.sky" as="shell" /> | 6 <import src="/sky/framework/shell.sky" as="shell" /> |
7 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> | 7 <import src="/sky/framework/sky-element/sky-element.sky" as="SkyElement" /> |
8 <import src="/mojo/services/keyboard/public/interfaces/keyboard.mojom.sky" as="k
eyboard" /> | 8 <import src="/mojo/services/keyboard/public/interfaces/keyboard.mojom.sky" as="k
eyboard" /> |
9 | 9 |
10 <sky-element name="sky-input" attributes="value:string"> | 10 <sky-element name="sky-input" attributes="value:string"> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 }.bind(this)); | 50 }.bind(this)); |
51 | 51 |
52 observer.observe(control, { | 52 observer.observe(control, { |
53 subtree: true, | 53 subtree: true, |
54 characterData: true, | 54 characterData: true, |
55 childList: true, | 55 childList: true, |
56 }); | 56 }); |
57 } | 57 } |
58 handleKeyDown(event) { | 58 handleKeyDown(event) { |
59 // TODO(abarth): You can still get newlines if the user pastes them. | 59 // TODO(abarth): You can still get newlines if the user pastes them. |
60 if (event.keyCode == 0xD) | 60 if (event.virtualKeyCode == 0xD) |
61 event.preventDefault(); | 61 event.preventDefault(); |
62 } | 62 } |
63 handleFocus(event) { | 63 handleFocus(event) { |
64 keyboard.show(); | 64 keyboard.show(); |
65 } | 65 } |
66 handleBlur(event) { | 66 handleBlur(event) { |
67 keyboard.hide(); | 67 keyboard.hide(); |
68 } | 68 } |
69 }.register(); | 69 }.register(); |
70 </script> | 70 </script> |
71 </sky-element> | 71 </sky-element> |
OLD | NEW |