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

Unified Diff: chrome/browser/resources/settings/settings_page/main_page_behavior.js

Issue 2302703002: MD Settings: fix infinite setInterval loop (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
Index: chrome/browser/resources/settings/settings_page/main_page_behavior.js
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
index 78bfe20f7512cb76e14f133ccba95ad8b8bd513a..7a53a64bac54c0e4129f34cdf29acddc88c260dc 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -31,6 +31,11 @@ function doWhenReady(readyTest, readyCallback) {
* @polymerBehavior MainPageBehavior
*/
var MainPageBehaviorImpl = {
+ properties: {
+ // Name of the root route corresponding to this page.
+ route: String,
+ },
+
/** @type {?HTMLElement} The scrolling container. */
scroller: null,
@@ -54,7 +59,14 @@ var MainPageBehaviorImpl = {
} else {
doWhenReady(
function() {
- return this.scrollHeight > 0;
+ if (this.scrollHeight > 0)
+ return true;
+
+ // Height is irrelevant if this page isn't the current page.
Dan Beam 2016/09/01 03:05:15 nit: // This is not the page you're looking for.
dschuyler 2016/09/01 18:28:42 nit: I suggest dropping the comment (rather than
+ if (!settings.Route[this.route].contains(settings.getCurrentRoute()))
tommycli 2016/09/01 18:14:24 holy shit that's clever.
michaelpg 2016/09/01 19:34:46 I was hoping to just do: if (this.domHost.get
+ return true;
+
+ return false;
dschuyler 2016/09/01 20:38:02 Please combine these into: return this.scrollHeig
}.bind(this),
this.tryTransitionToSection_.bind(this));
}

Powered by Google App Engine
This is Rietveld 408576698