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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 }, | 71 }, |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 /** @override */ | 74 /** @override */ |
| 75 attached: function() { | 75 attached: function() { |
| 76 document.addEventListener('toggle-advanced-page', function(e) { | 76 document.addEventListener('toggle-advanced-page', function(e) { |
| 77 this.advancedToggleExpanded_ = e.detail; | 77 this.advancedToggleExpanded_ = e.detail; |
| 78 settings.navigateTo(this.advancedToggleExpanded_ ? | 78 settings.navigateTo(this.advancedToggleExpanded_ ? |
| 79 settings.Route.ADVANCED : settings.Route.BASIC); | 79 settings.Route.ADVANCED : settings.Route.BASIC); |
| 80 }.bind(this)); | 80 }.bind(this)); |
| 81 | |
| 82 var mainContainer = this.domHost.$$('paper-header-panel').$.mainContainer; | |
|
Dan Beam
2016/08/03 01:30:09
can we not poke into paper-header-panel's local DO
dschuyler
2016/08/03 19:23:08
I changed it to something a bit more direct.
I'm n
| |
| 83 var overscroll = this.$.overscroll; | |
| 84 mainContainer.addEventListener('scroll', function() { | |
| 85 // TODO(dschuyler): This works okay, but not perfectly with page-up/down | |
| 86 // and home/end. It may have to do with the order in which the resize | |
| 87 // occurs (relative to the scroll action). | |
| 88 var visibleBottom = mainContainer.scrollTop + mainContainer.clientHeight; | |
| 89 var overscrollBottom = overscroll.offsetTop + overscroll.scrollHeight; | |
| 90 // How much of the overscroll is visible (may be negative). | |
| 91 var visibleOverscroll = overscroll.scrollHeight - | |
| 92 (overscrollBottom - visibleBottom); | |
| 93 if (visibleOverscroll > 0) | |
|
Dan Beam
2016/08/03 01:30:09
so why are we only setting this when overscroll >
dschuyler
2016/08/03 19:23:08
Done.
That would be logically the same, but funct
| |
| 94 overscroll.style.paddingBottom = visibleOverscroll + 'px'; | |
| 95 }.bind(this)); | |
| 81 }, | 96 }, |
| 82 | 97 |
| 83 /** | 98 /** |
| 84 * @param {boolean} opened Whether the menu is expanded. | 99 * @param {boolean} opened Whether the menu is expanded. |
| 85 * @return {string} Which icon to use. | 100 * @return {string} Which icon to use. |
| 86 * @private | 101 * @private |
| 87 */ | 102 */ |
| 88 arrowState_: function(opened) { | 103 arrowState_: function(opened) { |
| 89 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; | 104 return opened ? 'settings:arrow-drop-up' : 'cr:arrow-drop-down'; |
| 90 }, | 105 }, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 | 223 |
| 209 /** | 224 /** |
| 210 * @param {(boolean|undefined)} visibility | 225 * @param {(boolean|undefined)} visibility |
| 211 * @return {boolean} True unless visibility is false. | 226 * @return {boolean} True unless visibility is false. |
| 212 * @private | 227 * @private |
| 213 */ | 228 */ |
| 214 showAdvancedSettings_: function(visibility) { | 229 showAdvancedSettings_: function(visibility) { |
| 215 return visibility !== false; | 230 return visibility !== false; |
| 216 }, | 231 }, |
| 217 }); | 232 }); |
| OLD | NEW |