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

Side by Side Diff: chrome/browser/resources/settings/site_settings/edit_exception_dialog.js

Issue 2795353002: WebUI: For cr-dialog, handle Enter keys in paper-inputs. (Closed)
Patch Set: update tests Created 3 years, 8 months 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 'settings-edit-exception-dialog' is a component for editing a 6 * @fileoverview 'settings-edit-exception-dialog' is a component for editing a
7 * site exception entry. 7 * site exception entry.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-edit-exception-dialog', 10 is: 'settings-edit-exception-dialog',
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 this.origin_, 59 this.origin_,
60 this.origin_, 60 this.origin_,
61 this.model.category, 61 this.model.category,
62 this.model.setting, 62 this.model.setting,
63 this.model.incognito); 63 this.model.incognito);
64 } 64 }
65 65
66 this.$.dialog.close(); 66 this.$.dialog.close();
67 }, 67 },
68 68
69 /**
70 * @param {!KeyboardEvent} e
71 * @private
72 */
73 onKeypress_: function(e) {
74 if (e.key == 'Enter' && !this.$.actionButton.disabled)
75 this.onActionButtonTap_();
76 },
77
78 /** @private */ 69 /** @private */
79 validate_: function() { 70 validate_: function() {
80 if (this.$$('paper-input').value.trim() == '') { 71 if (this.$$('paper-input').value.trim() == '') {
81 this.invalid_ = true; 72 this.invalid_ = true;
82 return; 73 return;
83 } 74 }
84 75
85 this.browserProxy_.isPatternValid(this.origin_).then(function(isValid) { 76 this.browserProxy_.isPatternValid(this.origin_).then(function(isValid) {
86 this.invalid_ = !isValid; 77 this.invalid_ = !isValid;
87 }.bind(this)); 78 }.bind(this));
88 }, 79 },
89 }); 80 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698