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

Unified Diff: ui/webui/resources/cr_elements/cr_scrollable_behavior.js

Issue 2441173002: MD Settings: Ensure iron-lists are populated and sized correctly.
Patch Set: Undo Created 4 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/cr_elements/cr_scrollable_behavior.js
diff --git a/ui/webui/resources/cr_elements/cr_scrollable_behavior.js b/ui/webui/resources/cr_elements/cr_scrollable_behavior.js
index 407fb396a8ac2e85c545f62ad4ce9b437ce16bc2..491ec506cff0049d139387c7614ca9bfc4138f9f 100644
--- a/ui/webui/resources/cr_elements/cr_scrollable_behavior.js
+++ b/ui/webui/resources/cr_elements/cr_scrollable_behavior.js
@@ -65,23 +65,11 @@ var CrScrollableBehavior = {
* containers are resized correctly.
*/
updateScrollableContents() {
- let nodeList = this.root.querySelectorAll('[scrollable] iron-list');
- // Use setTimeout to avoid initial render / sizing issues.
- let intervalId = setInterval(function() {
- let unreadyNodes = [];
- for (let node of nodeList) {
- if (node.parentNode.scrollHeight == 0) {
- unreadyNodes.push(node);
- continue;
- }
- let ironList = /** @type {!IronListElement} */ (node);
- ironList.notifyResize();
- }
- if (unreadyNodes.length == 0)
- clearInterval(intervalId);
- else
- nodeList = unreadyNodes;
- }, 10);
+ this.async(function() {
+ let lists = this.root.querySelectorAll('[scrollable] iron-list');
+ for (list of lists)
+ list.fire('iron-resize');
+ }.bind(this));
stevenjb 2016/10/24 21:35:35 Assuming this works, then sweet, lgtm! See comment
dpapad 2016/10/24 22:24:34 Yes, the bind() call works as expected.
},
/**
« 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