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

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

Issue 2562153002: MD Settings: Fix CrOS /help/details edge case for MainPageBehavior. (Closed)
Patch Set: Created 4 years 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 else 59 else
60 this.tryTransitionToSection_(scrollToSection); 60 this.tryTransitionToSection_(scrollToSection);
61 }, 61 },
62 62
63 /** 63 /**
64 * When exiting search mode, we need to make another attempt to scroll to 64 * When exiting search mode, we need to make another attempt to scroll to
65 * the correct section, since it has just been re-rendered. 65 * the correct section, since it has just been re-rendered.
66 * @private 66 * @private
67 */ 67 */
68 inSearchModeChanged_: function(inSearchMode) { 68 inSearchModeChanged_: function(inSearchMode) {
69 if (!this.isAttached)
70 return;
71
69 if (!inSearchMode) 72 if (!inSearchMode)
70 this.tryTransitionToSection_(!settings.lastRouteChangeWasPopstate()); 73 this.tryTransitionToSection_(!settings.lastRouteChangeWasPopstate());
71 }, 74 },
72 75
73 /** 76 /**
74 * If possible, transitions to the current route's section (by expanding or 77 * If possible, transitions to the current route's section (by expanding or
75 * scrolling to it). If another transition is running, finishes or cancels 78 * scrolling to it). If another transition is running, finishes or cancels
76 * that one, then schedules this function again. This ensures the current 79 * that one, then schedules this function again. This ensures the current
77 * section is quickly shown, without getting the page into a broken state -- 80 * section is quickly shown, without getting the page into a broken state --
78 * if currentRoute changes in between calls, just transition to the new route. 81 * if currentRoute changes in between calls, just transition to the new route.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return /** @type {?SettingsSectionElement} */( 298 return /** @type {?SettingsSectionElement} */(
296 this.$$('settings-section[section="' + section + '"]')); 299 this.$$('settings-section[section="' + section + '"]'));
297 }, 300 },
298 }; 301 };
299 302
300 /** @polymerBehavior */ 303 /** @polymerBehavior */
301 var MainPageBehavior = [ 304 var MainPageBehavior = [
302 settings.RouteObserverBehavior, 305 settings.RouteObserverBehavior,
303 MainPageBehaviorImpl, 306 MainPageBehaviorImpl,
304 ]; 307 ];
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