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

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

Issue 2379913003: Site Settings Desktop: Polish the Site Data details dialog. (Closed)
Patch Set: Address feedback Created 4 years, 3 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
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_data_details_dialog.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
diff --git a/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js b/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
index 1bf1018d81c7ef49e0b2cf70fa0678a4b431faa4..9bfbdb0b6dc5c89d0975233f400c4a906509c776 100644
--- a/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
+++ b/chrome/browser/resources/settings/site_settings/site_data_details_dialog.js
@@ -57,6 +57,15 @@ Polymer({
},
/**
+ * Closes the dialog, if open.
+ */
+ close: function() {
+ var dialog = /** @type {!CrDialogElement} */(this.$.dialog);
+ if (dialog.open)
+ dialog.close();
+ },
+
+ /**
* Populates the dialog with the data about the site.
* @private
*/
@@ -128,8 +137,8 @@ Polymer({
*/
onTreeItemRemoved_: function(args) {
this.entries_ = this.site_.getCookieList();
- if (args.id == this.site_.data_.id || this.entries_.length == 0) {
- this.$.dialog.close();
+ if (this.site_.children_.length == 0 || this.entries_.length == 0) {
+ this.close();
return;
}
@@ -183,7 +192,7 @@ Polymer({
onRemoveAll_: function(event) {
cr.removeWebUIListener(this.listener_);
this.browserProxy.removeCookie(this.site_.data_.id);
- this.$.dialog.close();
+ this.close();
},
/** @private */
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_data_details_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698