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

Side by Side Diff: chrome/browser/resources/settings/settings_page/main_page_behavior.js

Issue 2773813004: MD Settings: Fix About page exception with Advanced lazy loading (Closed)
Patch Set: reorder Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Responds to route changes by expanding, collapsing, or scrolling to sections 6 * Responds to route changes by expanding, collapsing, or scrolling to sections
7 * on the page. Expanded sections take up the full height of the container. At 7 * on the page. Expanded sections take up the full height of the container. At
8 * most one section should be expanded at any given time. 8 * most one section should be expanded at any given time.
9 * @polymerBehavior MainPageBehavior 9 * @polymerBehavior MainPageBehavior
10 */ 10 */
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } else { 137 } else {
138 // Scroll to top while sliding to another subpage. 138 // Scroll to top while sliding to another subpage.
139 this.scroller.scrollTop = 0; 139 this.scroller.scrollTop = 0;
140 } 140 }
141 } else if (currentSection) { 141 } else if (currentSection) {
142 // Expand the section into a subpage or scroll to it on the main page. 142 // Expand the section into a subpage or scroll to it on the main page.
143 if (currentRoute.isSubpage()) 143 if (currentRoute.isSubpage())
144 promise = this.expandSection_(currentSection); 144 promise = this.expandSection_(currentSection);
145 else if (scrollToSection) 145 else if (scrollToSection)
146 currentSection.scrollIntoView(); 146 currentSection.scrollIntoView();
147 } else if (settings.Route.ADVANCED.contains(currentRoute) && 147 } else if (
148 this.tagName == 'SETTINGS-BASIC-PAGE' &&
149 settings.Route.ADVANCED.contains(currentRoute) &&
148 // Need to exclude routes that correspond to 'non-sectioned' children of 150 // Need to exclude routes that correspond to 'non-sectioned' children of
149 // ADVANCED, otherwise tryTransitionToSection_ will recurse endlessly. 151 // ADVANCED, otherwise tryTransitionToSection_ will recurse endlessly.
150 !currentRoute.isNavigableDialog) { 152 !currentRoute.isNavigableDialog) {
151 assert(currentRoute.section); 153 assert(currentRoute.section);
152 promise = this.$$('#advancedPageTemplate').get(); 154 promise = this.$$('#advancedPageTemplate').get();
153 } 155 }
154 156
155 // When this animation ends, another may be necessary. Call this function 157 // When this animation ends, another may be necessary. Call this function
156 // again after the promise resolves. 158 // again after the promise resolves.
157 if (promise) 159 if (promise)
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 return /** @type {?SettingsSectionElement} */( 340 return /** @type {?SettingsSectionElement} */(
339 this.$$('settings-section[section="' + section + '"]')); 341 this.$$('settings-section[section="' + section + '"]'));
340 }, 342 },
341 }; 343 };
342 344
343 /** @polymerBehavior */ 345 /** @polymerBehavior */
344 var MainPageBehavior = [ 346 var MainPageBehavior = [
345 settings.RouteObserverBehavior, 347 settings.RouteObserverBehavior,
346 MainPageBehaviorImpl, 348 MainPageBehaviorImpl,
347 ]; 349 ];
OLDNEW
« 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