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

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: Remove scroll container class, seemed to have no effect. 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
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));
},
/**

Powered by Google App Engine
This is Rietveld 408576698