Chromium Code Reviews| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 created: function() { | 62 created: function() { |
| 63 /** @private {!PromiseResolver} */ | 63 /** @private {!PromiseResolver} */ |
| 64 this.resolver_ = new PromiseResolver; | 64 this.resolver_ = new PromiseResolver; |
| 65 settings.main.rendered = this.resolver_.promise; | 65 settings.main.rendered = this.resolver_.promise; |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 attached: function() { | 68 attached: function() { |
| 69 document.addEventListener('toggle-advanced-page', function(e) { | 69 document.addEventListener('toggle-advanced-page', function(e) { |
| 70 this.showAdvancedPage_ = e.detail; | 70 this.showAdvancedPage_ = e.detail; |
| 71 this.isAdvancedMenuOpen_ = e.detail; | 71 this.isAdvancedMenuOpen_ = e.detail; |
| 72 this.currentRoute = { | |
| 73 page: this.isAdvancedMenuOpen_ ? 'advanced' : 'basic', | |
| 74 section: '', | |
|
Dan Beam
2016/07/01 01:11:51
I assume the section should be '' and not 'privacy
dschuyler
2016/07/01 22:31:22
I believe so.
| |
| 75 subpage: [], | |
| 76 }; | |
| 72 if (this.showAdvancedPage_) { | 77 if (this.showAdvancedPage_) { |
| 73 doWhenReady( | 78 doWhenReady( |
| 74 function() { | 79 function() { |
| 75 var advancedPage = this.$$('settings-advanced-page'); | 80 var advancedPage = this.$$('settings-advanced-page'); |
| 76 return !!advancedPage && advancedPage.scrollHeight > 0; | 81 return !!advancedPage && advancedPage.scrollHeight > 0; |
| 77 }.bind(this), | 82 }.bind(this), |
| 78 function() { | 83 function() { |
| 79 this.$$('#toggleContainer').scrollIntoView(); | 84 this.$$('#toggleContainer').scrollIntoView(); |
| 80 }.bind(this)); | 85 }.bind(this)); |
| 81 } | 86 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 newRoute.page == 'advanced'; | 123 newRoute.page == 'advanced'; |
| 119 | 124 |
| 120 this.style.height = isSubpage ? '100%' : ''; | 125 this.style.height = isSubpage ? '100%' : ''; |
| 121 }, | 126 }, |
| 122 | 127 |
| 123 /** @private */ | 128 /** @private */ |
| 124 toggleAdvancedPage_: function() { | 129 toggleAdvancedPage_: function() { |
| 125 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_); | 130 this.fire('toggle-advanced-page', !this.isAdvancedMenuOpen_); |
| 126 }, | 131 }, |
| 127 }); | 132 }); |
| OLD | NEW |