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

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

Issue 2208333002: MD Settings: Ensure sections are shown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 // Fast out, slow in. 5 // Fast out, slow in.
6 var EASING_FUNCTION = 'cubic-bezier(0.4, 0, 0.2, 1)'; 6 var EASING_FUNCTION = 'cubic-bezier(0.4, 0, 0.2, 1)';
7 var EXPAND_DURATION = 350; 7 var EXPAND_DURATION = 350;
8 8
9 /** 9 /**
10 * Calls |readyTest| repeatedly until it returns true, then calls 10 * Calls |readyTest| repeatedly until it returns true, then calls
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 }, 48 },
49 49
50 /** 50 /**
51 * Hides or unhides the sections not being expanded. 51 * Hides or unhides the sections not being expanded.
52 * @param {string} sectionName The section to keep visible. 52 * @param {string} sectionName The section to keep visible.
53 * @param {boolean} hidden Whether the sections should be hidden. 53 * @param {boolean} hidden Whether the sections should be hidden.
54 * @private 54 * @private
55 */ 55 */
56 toggleOtherSectionsHidden_: function(sectionName, hidden) { 56 toggleOtherSectionsHidden_: function(sectionName, hidden) {
57 var sections = Polymer.dom(this.root).querySelectorAll( 57 var sections = Polymer.dom(this.root).querySelectorAll(
58 this.sectionSelector + ':not([section=' + sectionName + '])'); 58 this.sectionSelector);
59 for (var section of sections) 59 for (var section of sections)
60 section.hidden = hidden; 60 section.hidden = hidden && (section.section != sectionName);
Dan Beam 2016/08/04 01:10:27 nit that i didn't bother to previously say: i don'
michaelpg 2016/08/04 01:36:42 i'm really stingy with my parens, which used to be
61 }, 61 },
62 62
63 /** 63 /**
64 * Animates the card in |section|, expanding it to fill the page. 64 * Animates the card in |section|, expanding it to fill the page.
65 * @param {!SettingsSectionElement} section 65 * @param {!SettingsSectionElement} section
66 */ 66 */
67 expandSection: function(section) { 67 expandSection: function(section) {
68 // If another section's card is expanding, cancel that animation first. 68 // If another section's card is expanding, cancel that animation first.
69 var expanding = this.$$('.expanding'); 69 var expanding = this.$$('.expanding');
70 if (expanding) { 70 if (expanding) {
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 this.$$('[section=' + section + ']')); 427 this.$$('[section=' + section + ']'));
428 }, 428 },
429 }; 429 };
430 430
431 431
432 /** @polymerBehavior */ 432 /** @polymerBehavior */
433 var RoutableBehavior = [ 433 var RoutableBehavior = [
434 MainPageBehavior, 434 MainPageBehavior,
435 RoutableBehaviorImpl 435 RoutableBehaviorImpl
436 ]; 436 ];
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