| 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 * @typedef {{about: boolean, basic: boolean, advanced: boolean}} | 6 * @typedef {{about: boolean, basic: boolean, advanced: boolean}} |
| 7 */ | 7 */ |
| 8 var MainPageVisibility; | 8 var MainPageVisibility; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 pageVisibility: { | 81 pageVisibility: { |
| 82 type: Object, | 82 type: Object, |
| 83 value: function() { return {}; }, | 83 value: function() { return {}; }, |
| 84 }, | 84 }, |
| 85 }, | 85 }, |
| 86 | 86 |
| 87 /** @override */ | 87 /** @override */ |
| 88 attached: function() { | 88 attached: function() { |
| 89 document.addEventListener('toggle-advanced-page', function(e) { | 89 document.addEventListener('toggle-advanced-page', function(e) { |
| 90 this.advancedToggleExpanded_ = e.detail; | 90 this.advancedToggleExpanded_ = e.detail; |
| 91 settings.navigateTo(this.advancedToggleExpanded_ ? | 91 this.currentRouteChanged(settings.getCurrentRoute()); |
| 92 settings.Route.ADVANCED : settings.Route.BASIC); | |
| 93 }.bind(this)); | 92 }.bind(this)); |
| 94 | |
| 95 }, | 93 }, |
| 96 | 94 |
| 97 /** @private */ | 95 /** @private */ |
| 98 overscrollChanged_: function() { | 96 overscrollChanged_: function() { |
| 99 if (!this.overscroll_ && this.boundScroll_) { | 97 if (!this.overscroll_ && this.boundScroll_) { |
| 100 this.parentNode.scroller.removeEventListener('scroll', this.boundScroll_); | 98 this.parentNode.scroller.removeEventListener('scroll', this.boundScroll_); |
| 101 this.boundScroll_ = null; | 99 this.boundScroll_ = null; |
| 102 } else if (this.overscroll_ && !this.boundScroll_) { | 100 } else if (this.overscroll_ && !this.boundScroll_) { |
| 103 this.boundScroll_ = this.scrollEventListener_.bind(this); | 101 this.boundScroll_ = this.scrollEventListener_.bind(this); |
| 104 this.parentNode.scroller.addEventListener('scroll', this.boundScroll_); | 102 this.parentNode.scroller.addEventListener('scroll', this.boundScroll_); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 258 |
| 261 /** | 259 /** |
| 262 * @param {(boolean|undefined)} visibility | 260 * @param {(boolean|undefined)} visibility |
| 263 * @return {boolean} True unless visibility is false. | 261 * @return {boolean} True unless visibility is false. |
| 264 * @private | 262 * @private |
| 265 */ | 263 */ |
| 266 showAdvancedSettings_: function(visibility) { | 264 showAdvancedSettings_: function(visibility) { |
| 267 return visibility !== false; | 265 return visibility !== false; |
| 268 }, | 266 }, |
| 269 }); | 267 }); |
| OLD | NEW |