Commit 9d6d4198 authored by michaelpg's avatar michaelpg Committed by Commit bot

MD Settings: shrink overscroll on resize

Recalculate overscroll when shrinking the page, so we don't end up with
a scrollbar for the empty space below us.

BUG=none
R=dschuyler@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2382603002
Cr-Commit-Position: refs/heads/master@{#422684}
parent 1ce8eb06
...@@ -103,6 +103,7 @@ Polymer({ ...@@ -103,6 +103,7 @@ Polymer({
overscrollChanged_: function() { overscrollChanged_: function() {
if (!this.overscroll_ && this.boundScroll_) { if (!this.overscroll_ && this.boundScroll_) {
this.offsetParent.removeEventListener('scroll', this.boundScroll_); this.offsetParent.removeEventListener('scroll', this.boundScroll_);
window.removeEventListener('resize', this.boundScroll_);
this.boundScroll_ = null; this.boundScroll_ = null;
} else if (this.overscroll_ && !this.boundScroll_) { } else if (this.overscroll_ && !this.boundScroll_) {
this.boundScroll_ = function() { this.boundScroll_ = function() {
...@@ -110,6 +111,7 @@ Polymer({ ...@@ -110,6 +111,7 @@ Polymer({
this.setOverscroll_(0); this.setOverscroll_(0);
}.bind(this); }.bind(this);
this.offsetParent.addEventListener('scroll', this.boundScroll_); this.offsetParent.addEventListener('scroll', this.boundScroll_);
window.addEventListener('resize', this.boundScroll_);
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment