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

Side by Side Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2106013002: Move settings-section animations into setting-section, make better (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Transitions
Patch Set: rebase, minor fix Created 4 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * @fileoverview 6 * @fileoverview
7 * 'settings-main' displays the selected settings page. 7 * 'settings-main' displays the selected settings page.
8 */ 8 */
9 Polymer({ 9 Polymer({
10 is: 'settings-main', 10 is: 'settings-main',
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 * */ 103 * */
104 arrowState_: function(opened) { 104 arrowState_: function(opened) {
105 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; 105 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down';
106 }, 106 },
107 107
108 /** 108 /**
109 * @param {!SettingsRoute} newRoute 109 * @param {!SettingsRoute} newRoute
110 * @private 110 * @private
111 */ 111 */
112 currentRouteChanged_: function(newRoute) { 112 currentRouteChanged_: function(newRoute) {
113 var isSubpage = !!newRoute.subpage.length; 113 var isSubpage = !!newRoute.subpage.length;
dschuyler 2016/07/07 18:46:21 Is isSubpage unused?
michaelpg 2016/07/08 00:19:02 Done.
114 114
115 this.showAboutPage_ = newRoute.page == 'about'; 115 this.showAboutPage_ = newRoute.page == 'about';
116 116
117 this.showAdvancedToggle_ = !this.showAboutPage_ && !isSubpage; 117 this.showAdvancedToggle_ = !this.showAboutPage_;
118 118
119 this.showBasicPage_ = this.showAdvancedToggle_ || newRoute.page == 'basic'; 119 this.showBasicPage_ = !this.showAboutPage_;
120 120
121 this.showAdvancedPage_ = 121 this.showAdvancedPage_ = this.showAdvancedPage_ ||
122 (this.isAdvancedMenuOpen_ && this.showAdvancedToggle_) || 122 (this.isAdvancedMenuOpen_ && this.showAdvancedToggle_) ||
123 newRoute.page == 'advanced'; 123 newRoute.page == 'advanced';
124 },
124 125
125 this.style.height = isSubpage ? '100%' : ''; 126 subpageExpanded_: function() {
127 this.showBasicPage_ = this.currentRoute.page == 'basic';
128 this.showAdvancedPage_ = !this.showBasicPage_;
129 this.showAdvancedToggle_ = false;
130 },
131
132 subpageCollapsing_: function() {
133 this.currentRouteChanged_(this.currentRoute);
126 }, 134 },
127 135
128 /** @private */ 136 /** @private */
129 toggleAdvancedPage_: function() { 137 toggleAdvancedPage_: function() {
130 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_); 138 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_);
131 }, 139 },
132 }); 140 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698