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

Unified Diff: chrome/browser/resources/settings/site_settings/add_site_dialog.js

Issue 2783513002: MD Settings: Display error messages in "add" and "edit" exception dialogs. (Closed)
Patch Set: Remove left overs (again) Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/site_settings/add_site_dialog.js
diff --git a/chrome/browser/resources/settings/site_settings/add_site_dialog.js b/chrome/browser/resources/settings/site_settings/add_site_dialog.js
index 59d1ac63ff905120514d2535913b9842a8a94daa..537f5cb16c0b6b8da9fbf033cee70b910d1fe423 100644
--- a/chrome/browser/resources/settings/site_settings/add_site_dialog.js
+++ b/chrome/browser/resources/settings/site_settings/add_site_dialog.js
@@ -55,7 +55,16 @@ Polymer({
* @private
*/
validate_: function() {
+ // If input is empty, disable the action button, but don't show the red
+ // invalid message.
+ if (this.$.site.value.trim() == '') {
+ this.$.site.invalid = false;
+ this.$.add.disabled = true;
+ return;
+ }
+
this.browserProxy.isPatternValid(this.site_).then(function(isValid) {
+ this.$.site.invalid = !isValid;
this.$.add.disabled = !isValid;
}.bind(this));
},

Powered by Google App Engine
This is Rietveld 408576698