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

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

Issue 2184863002: MD Settings: Remove paper-header-panel, use IntersectionObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve conflicts Created 3 years, 9 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_ui/settings_ui.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_ui/settings_ui.js
diff --git a/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chrome/browser/resources/settings/settings_ui/settings_ui.js
index e3c3ca1aba5b7eb729056b7ef8dd578cb04cf17b..afc8726873188ce436ee3b1e39a9702e29660741 100644
--- a/chrome/browser/resources/settings/settings_ui/settings_ui.js
+++ b/chrome/browser/resources/settings/settings_ui/settings_ui.js
@@ -160,6 +160,9 @@ Polymer({
loadTimeData.getBoolean('androidAppsAllowed');
},
+ /** @private {?IntersectionObserver} */
+ intersectionObserver_: null,
+
/** @override */
attached: function() {
setTimeout(function() {
@@ -169,12 +172,29 @@ Polymer({
});
// Preload bold Roboto so it doesn't load and flicker the first time used.
document.fonts.load('bold 12px Roboto');
- settings.setGlobalScrollTarget(this.$.headerPanel.scroller);
+ settings.setGlobalScrollTarget(this.$.container);
+
+ // Setup drop shadow logic.
+ var callback = function(entries) {
+ assert(entries.length == 1);
+ this.$.dropShadow.classList.toggle(
+ 'has-shadow', entries[0].intersectionRatio == 0);
+ }.bind(this);
+
+ this.intersectionObserver_ = new IntersectionObserver(
+ callback,
+ /** @type {IntersectionObserverInit} */ ({
+ root: this.$.container,
+ threshold: 0,
+ }));
+ this.intersectionObserver_.observe(this.$.intersectionProbe);
},
/** @override */
detached: function() {
settings.resetRouteForTesting();
+ this.intersectionObserver_.disconnect();
+ this.intersectionObserver_ = null;
},
/** @param {!settings.Route} route */
« no previous file with comments | « chrome/browser/resources/settings/settings_ui/settings_ui.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698