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..bf07a8f1bea880f4d05f8704ae8ebe1ad067a511 100644 |
| --- a/chrome/browser/resources/settings/settings_main/settings_main.js |
| +++ b/chrome/browser/resources/settings/settings_main/settings_main.js |
| @@ -78,6 +78,20 @@ Polymer({ |
| settings.navigateTo(this.advancedToggleExpanded_ ? |
| settings.Route.ADVANCED : settings.Route.BASIC); |
| }.bind(this)); |
| + |
| + var mainContainer = this.parentNode.$.mainContainer; |
|
Dan Beam
2016/08/03 20:50:32
can we just use this.parentNode.scroller?
dschuyler
2016/08/03 21:46:41
Done.
|
| + var overscroll = this.$.overscroll; |
| + mainContainer.addEventListener('scroll', function() { |
|
Dan Beam
2016/08/03 20:50:32
can we only listen to scroll when there is padding
dschuyler
2016/08/03 21:46:41
Done.
|
| + // 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). |
|
Dan Beam
2016/08/03 20:50:32
^ you can remove this now, I think
dschuyler
2016/08/03 21:46:41
Done.
|
| + 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); |
| + overscroll.style.paddingBottom = Math.max(0, visibleOverscroll) + 'px'; |
| + }.bind(this)); |
| }, |
| /** |