| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'pin-keyboard' is a keyboard that can be used to enter PINs or more generally | 7 * 'pin-keyboard' is a keyboard that can be used to enter PINs or more generally |
| 8 * numeric values. | 8 * numeric values. |
| 9 * | 9 * |
| 10 * Properties: | 10 * Properties: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 properties: { | 28 properties: { |
| 29 /** The value stored in the keyboard's input element. */ | 29 /** The value stored in the keyboard's input element. */ |
| 30 value: { | 30 value: { |
| 31 type: String, | 31 type: String, |
| 32 notify: true, | 32 notify: true, |
| 33 value: '', | 33 value: '', |
| 34 observer: 'onPinValueChange_' | 34 observer: 'onPinValueChange_' |
| 35 } | 35 } |
| 36 }, | 36 }, |
| 37 | 37 |
| 38 /** |
| 39 * Gets the container holding the password field. |
| 40 * @type {!HTMLInputElement} |
| 41 */ |
| 42 get inputElement() { |
| 43 return this.$$('#pin-input'); |
| 44 }, |
| 45 |
| 46 /** |
| 47 * Gets the submit button. |
| 48 * @type {!HTMLElement} |
| 49 */ |
| 50 get submitButton() { |
| 51 return this.$$('.submit-button'); |
| 52 }, |
| 53 |
| 38 /** Transfers focus to the input element. */ | 54 /** Transfers focus to the input element. */ |
| 39 focus: function() { | 55 focus: function() { |
| 40 this.$$('#pin-input').focus(); | 56 this.$$('#pin-input').focus(); |
| 41 }, | 57 }, |
| 42 | 58 |
| 43 /** Called when a keypad number has been tapped. */ | 59 /** Called when a keypad number has been tapped. */ |
| 44 onNumberTap_: function(event, detail) { | 60 onNumberTap_: function(event, detail) { |
| 45 var numberValue = event.target.getAttribute('value'); | 61 var numberValue = event.target.getAttribute('value'); |
| 46 this.value += numberValue; | 62 this.value += numberValue; |
| 47 }, | 63 }, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 }, | 103 }, |
| 88 | 104 |
| 89 /** | 105 /** |
| 90 * Changes the color of the submit button if PIN is ready. | 106 * Changes the color of the submit button if PIN is ready. |
| 91 * @param {string} value | 107 * @param {string} value |
| 92 */ | 108 */ |
| 93 computeSubmitClass_: function(value) { | 109 computeSubmitClass_: function(value) { |
| 94 return value.length > 0 ? 'ready-background' : ''; | 110 return value.length > 0 ? 'ready-background' : ''; |
| 95 } | 111 } |
| 96 }); | 112 }); |
| OLD | NEW |