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