Chromium Code Reviews| Index: chrome/browser/resources/settings/settings_main/settings_main.js |
| diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js |
| index 6aa8c1113f14754117d1c1a2bfb7fba3bd9b450b..da91aeab2701f29da46f2187efcbce28c74afcdf 100644 |
| --- a/chrome/browser/resources/settings/settings_main/settings_main.js |
| +++ b/chrome/browser/resources/settings/settings_main/settings_main.js |
| @@ -78,6 +78,21 @@ Polymer({ |
| settings.navigateTo(this.advancedToggleExpanded_ ? |
| settings.Route.ADVANCED : settings.Route.BASIC); |
| }.bind(this)); |
| + |
| + 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
|
| + var overscroll = this.$.overscroll; |
| + mainContainer.addEventListener('scroll', function() { |
| + // TODO(dschuyler): This works okay, but not perfectly with page-up/down |
| + // and home/end. It may have to do with the order in which the resize |
| + // occurs (relative to the scroll action). |
| + var visibleBottom = mainContainer.scrollTop + mainContainer.clientHeight; |
| + var overscrollBottom = overscroll.offsetTop + overscroll.scrollHeight; |
| + // How much of the overscroll is visible (may be negative). |
| + var visibleOverscroll = overscroll.scrollHeight - |
| + (overscrollBottom - visibleBottom); |
| + 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
|
| + overscroll.style.paddingBottom = visibleOverscroll + 'px'; |
| + }.bind(this)); |
| }, |
| /** |