Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2206723002: [MD settings] shrink overscroll when scrolling up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/settings/settings_main/settings_main.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
},
/**
« no previous file with comments | « chrome/browser/resources/settings/settings_main/settings_main.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698