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 676429b994c7533a5426cb7ced6b98673c6cadf0..748f8bc28d371b575b50e10044c958a730afeef6 100644 |
| --- a/chrome/browser/resources/settings/settings_main/settings_main.js |
| +++ b/chrome/browser/resources/settings/settings_main/settings_main.js |
| @@ -85,13 +85,17 @@ Polymer({ |
| this.parentNode.scroller.removeEventListener('scroll', this.boundScroll_); |
| this.boundScroll_ = null; |
| } else if (this.overscroll_ && !this.boundScroll_) { |
| - this.boundScroll_ = this.scrollEventListener_.bind(this); |
| + this.boundScroll_ = this.setOverscroll_.bind(this, 0); |
| this.parentNode.scroller.addEventListener('scroll', this.boundScroll_); |
| } |
| }, |
| - /** @private */ |
| - scrollEventListener_: function() { |
| + /** |
| + * Sets the overscroll padding. Never forces a scroll, i.e., always leaves |
| + * any currently visible overflow as-is. |
| + * @param {number=} minHeight The minimum overscroll height needed. |
|
Dan Beam
2016/08/09 23:26:40
opt_minHeight
michaelpg
2016/08/09 23:46:09
Done.
|
| + */ |
| + setOverscroll_: function(opt_minHeight) { |
| var scroller = this.parentNode.scroller; |
| var overscroll = this.$.overscroll; |
| var visibleBottom = scroller.scrollTop + scroller.clientHeight; |
| @@ -99,7 +103,9 @@ Polymer({ |
| // How much of the overscroll is visible (may be negative). |
| var visibleOverscroll = overscroll.scrollHeight - |
| (overscrollBottom - visibleBottom); |
| - this.overscroll_ = Math.max(0, visibleOverscroll); |
| + if (typeof opt_minHeight == 'undefined') |
| + opt_minHeight = 0; |
| + this.overscroll_ = Math.max(opt_minHeight, visibleOverscroll); |
|
Dan Beam
2016/08/09 23:26:40
nit: opt_minHeight || 0
michaelpg
2016/08/09 23:46:09
Done.
|
| }, |
| /** |
| @@ -148,7 +154,7 @@ Polymer({ |
| // Ensure any dom-if reflects the current properties. |
| Polymer.dom.flush(); |
| - this.overscroll_ = this.overscrollHeight_(); |
| + this.setOverscroll_(this.overscrollHeight_()); |
| }.bind(this)); |
| }, |