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

Side by Side Diff: chrome/browser/resources/settings/internet_page/network_siminfo.js

Issue 2557073003: Call preventDefault in all on-tap events that show a dialog. (Closed)
Patch Set: nit Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 Polymer element for displaying and modifying cellular sim info. 6 * @fileoverview Polymer element for displaying and modifying cellular sim info.
7 */ 7 */
8 (function() { 8 (function() {
9 9
10 /** @enum {string} */ 10 /** @enum {string} */
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 this.$.enterPin.inputElement.select(); 138 this.$.enterPin.inputElement.select();
139 } else { 139 } else {
140 this.error_ = ErrorType.NONE; 140 this.error_ = ErrorType.NONE;
141 this.$.enterPinDialog.close(); 141 this.$.enterPinDialog.close();
142 } 142 }
143 }.bind(this)); 143 }.bind(this));
144 }, 144 },
145 145
146 /** 146 /**
147 * Opens the Change PIN dialog. 147 * Opens the Change PIN dialog.
148 * @param {Event} event 148 * @param {!Event} event
149 * @private 149 * @private
150 */ 150 */
151 onChangePinTap_: function(event) { 151 onChangePinTap_: function(event) {
152 if (!this.networkProperties || !this.networkProperties.Cellular) 152 if (!this.networkProperties || !this.networkProperties.Cellular)
153 return; 153 return;
154 event.preventDefault();
154 this.error_ = ErrorType.NONE; 155 this.error_ = ErrorType.NONE;
155 this.$.changePinDialog.showModal(); 156 this.$.changePinDialog.showModal();
156 this.$.changePinOld.value = ''; 157 this.$.changePinOld.value = '';
157 this.$.changePinNew1.value = ''; 158 this.$.changePinNew1.value = '';
158 this.$.changePinNew2.value = ''; 159 this.$.changePinNew2.value = '';
159 }, 160 },
160 161
161 /** 162 /**
162 * Sends the old and new PIN values from the Change PIN dialog. 163 * Sends the old and new PIN values from the Change PIN dialog.
163 * @param {Event} event 164 * @param {Event} event
(...skipping 16 matching lines...) Expand all
180 this.$.changePinOld.inputElement.select(); 181 this.$.changePinOld.inputElement.select();
181 } else { 182 } else {
182 this.error_ = ErrorType.NONE; 183 this.error_ = ErrorType.NONE;
183 this.$.changePinDialog.close(); 184 this.$.changePinDialog.close();
184 } 185 }
185 }.bind(this)); 186 }.bind(this));
186 }, 187 },
187 188
188 /** 189 /**
189 * Opens the Unlock PIN dialog. 190 * Opens the Unlock PIN dialog.
190 * @param {Event} event 191 * @param {!Event} event
191 * @private 192 * @private
192 */ 193 */
193 onUnlockPinTap_: function(event) { 194 onUnlockPinTap_: function(event) {
195 event.preventDefault();
194 this.error_ = ErrorType.NONE; 196 this.error_ = ErrorType.NONE;
195 this.$.unlockPinDialog.showModal(); 197 this.$.unlockPinDialog.showModal();
196 this.$.unlockPin.value = ''; 198 this.$.unlockPin.value = '';
197 }, 199 },
198 200
199 /** 201 /**
200 * Sends the PIN value from the Unlock PIN dialog. 202 * Sends the PIN value from the Unlock PIN dialog.
201 * @param {Event} event 203 * @param {Event} event
202 * @private 204 * @private
203 */ 205 */
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 */ 338 */
337 validatePuk_: function(puk) { 339 validatePuk_: function(puk) {
338 if (puk.length < PUK_MIN_LENGTH) { 340 if (puk.length < PUK_MIN_LENGTH) {
339 this.error_ = ErrorType.INVALID_PUK; 341 this.error_ = ErrorType.INVALID_PUK;
340 return false; 342 return false;
341 } 343 }
342 return true; 344 return true;
343 } 345 }
344 }); 346 });
345 })(); 347 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698