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

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

Issue 2370843002: Site Settings Desktop: Only show Remove action if filter hasn't removed all. (Closed)
Patch Set: 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.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.js
diff --git a/chrome/browser/resources/settings/site_settings/site_data.js b/chrome/browser/resources/settings/site_settings/site_data.js
index 116ad3dfcd074c2dbd02a82cee564c8adef9f595..c1f180c68d1ac8444766b339e7f9566f754809a5 100644
--- a/chrome/browser/resources/settings/site_settings/site_data.js
+++ b/chrome/browser/resources/settings/site_settings/site_data.js
@@ -74,16 +74,14 @@ Polymer({
onSearchChanged_: function(e) {
this.filterString_ = e.detail;
this.$.list.render();
- },
- /**
- * Returns whether remove all should be shown.
- * @param {!Array<!CookieDataSummaryItem>} sites The sites list to use to
- * determine whether the button should be visible.
- * @private
- */
- removeAllIsVisible_: function(sites) {
- return sites.length > 0;
+ // There seems to be a bug in renderedItemCount where it is always 0 after
tommycli 2016/09/26 23:01:34 why move this code from the computed binding? Wou
Finnur 2016/09/27 14:14:34 Good question. I tried both ways before and this i
+ // the list has been rendered initially (with no filter string applied), but
+ // then renderedItemCount matches the total |sites| count anyway.
+ if (this.filterString_ == '')
+ this.$.remove.hidden = this.sites.length == 0;
+ else
+ this.$.remove.hidden = this.$.list['renderedItemCount'] == 0;
tommycli 2016/09/26 23:01:34 list.renderedItemCount?
Dan Beam 2016/09/27 00:12:27 this is why: https://build.chromium.org/p/tryserve
Finnur 2016/09/27 14:14:34 Yup. Dan hit the nail on the head, but it is all m
},
/**
« no previous file with comments | « chrome/browser/resources/settings/site_settings/site_data.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698