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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 }, | 49 }, |
50 | 50 |
51 /** | 51 /** |
52 * Gets the container holding the password field. | 52 * Gets the container holding the password field. |
53 * @type {!HTMLInputElement} | 53 * @type {!HTMLInputElement} |
54 */ | 54 */ |
55 get inputElement() { | 55 get inputElement() { |
56 return this.$$('#pin-input'); | 56 return this.$$('#pin-input'); |
57 }, | 57 }, |
58 | 58 |
59 /** | |
60 * Gets the submit button. | |
61 * @type {!HTMLElement} | |
62 */ | |
63 get submitButton() { | |
64 return this.$$('.submit-button'); | |
65 }, | |
66 | |
67 /** Transfers focus to the input element. */ | 59 /** Transfers focus to the input element. */ |
68 focus: function() { | 60 focus: function() { |
69 this.$$('#pin-input').focus(); | 61 this.$$('#pin-input').focus(); |
70 }, | 62 }, |
71 | 63 |
72 /** | 64 /** |
73 * Called when a keypad number has been tapped. | 65 * Called when a keypad number has been tapped. |
74 * @param {!{target: !PaperButtonElement}} event | 66 * @param {!{target: !PaperButtonElement}} event |
75 * @private | 67 * @private |
76 */ | 68 */ |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // does not contain decimals. | 154 // does not contain decimals. |
163 // This heuristic will fail for inputs like '1.0'. | 155 // This heuristic will fail for inputs like '1.0'. |
164 // | 156 // |
165 // Since we still support users entering their passwords through the PIN | 157 // Since we still support users entering their passwords through the PIN |
166 // keyboard, we swap the input box to rtl when we think it is a password | 158 // keyboard, we swap the input box to rtl when we think it is a password |
167 // (just numbers), if the document direction is rtl. | 159 // (just numbers), if the document direction is rtl. |
168 var enableRtl = (document.dir == 'rtl') && !Number.isInteger(+password); | 160 var enableRtl = (document.dir == 'rtl') && !Number.isInteger(+password); |
169 return enableRtl ? 'input-non-pin' : ''; | 161 return enableRtl ? 'input-non-pin' : ''; |
170 } | 162 } |
171 }); | 163 }); |
OLD | NEW |