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

Unified Diff: chrome/browser/resources/net_internals/export_view.js

Issue 2562633003: Update save file button based on states (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/net_internals/export_view.js
diff --git a/chrome/browser/resources/net_internals/export_view.js b/chrome/browser/resources/net_internals/export_view.js
index 52829984922215ad954ebe4e2442f648694323da..c7b556e9d37ac9ae46d7c104fe773647941bd44f 100644
--- a/chrome/browser/resources/net_internals/export_view.js
+++ b/chrome/browser/resources/net_internals/export_view.js
@@ -27,9 +27,10 @@ var ExportView = (function() {
this.saveFileButton_ = $(ExportView.SAVE_FILE_BUTTON_ID);
this.saveFileButton_.onclick = this.onSaveFile_.bind(this);
this.saveStatusText_ = $(ExportView.SAVE_STATUS_TEXT_ID);
+ this.isSaving_ = false;
this.userCommentsTextArea_ = $(ExportView.USER_COMMENTS_TEXT_AREA_ID);
- this.enableSaveFileButton_(false);
+ this.updateSaveFileButton_();
this.userCommentsTextArea_.onkeyup = this.onUserCommentsUpdated_.bind(this);
// Track blob for previous log dump so it can be revoked when a new dump is
@@ -87,12 +88,14 @@ var ExportView = (function() {
* of failure.
*/
setSaveFileStatus: function(text, isSaving) {
- this.enableSaveFileButton_(!isSaving);
+ this.isSaving_ = isSaving;
+ this.updateSaveFileButton_();
this.saveStatusText_.textContent = text;
},
- enableSaveFileButton_: function(enabled) {
- this.saveFileButton_.disabled = !enabled;
+ updateSaveFileButton_: function() {
+ this.saveFileButton_.disabled =
+ this.userCommentsTextArea_.value == '' || this.isSaving_;
},
showPrivacyWarning: function() {
@@ -160,7 +163,7 @@ var ExportView = (function() {
* User comments are updated.
*/
onUserCommentsUpdated_: function() {
- this.enableSaveFileButton_(this.userCommentsTextArea_.value != '');
+ this.updateSaveFileButton_();
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698