| OLD | NEW |
| 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 Loading... |
| 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); |
| 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 Loading... |
| 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 ]; |
| OLD | NEW |