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

Unified Diff: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js

Issue 2795763003: MD Settings: adjust dialog style and scroll border visual (Closed)
Patch Set: modify cups dialog button to align by flexbox Created 3 years, 8 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 | « ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
index 4c49a3a9121eec83c30f99a13af9e20d5822d294..c98c75ac4053eda397cdc7758103f9edb91fd87d 100644
--- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
+++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
@@ -66,10 +66,21 @@ Polymer({
if (this.showScrollBorders) {
var bodyContainer = this.$$('.body-container');
+ var bottomMarker = this.$.bodyBottomMarker;
+ var topMarker = this.$.bodyTopMarker;
+
var callback = function(entries) {
- assert(entries.length == 1);
- bodyContainer.classList.toggle(
- 'bottom-scrollable', entries[0].intersectionRatio == 0);
+ assert(entries.length <= 2);
+ for (var i = 0; i < entries.length; i++) {
+ var target = entries[i].target;
+ assert(target == bottomMarker || target == topMarker);
+
+ var classToToggle =
+ target == bottomMarker ? 'bottom-scrollable' : 'top-scrollable';
+
+ bodyContainer.classList.toggle(
+ classToToggle, entries[i].intersectionRatio == 0);
+ }
};
this.intersectionObserver_ = new IntersectionObserver(
@@ -78,7 +89,8 @@ Polymer({
root: bodyContainer,
threshold: 0,
}));
- this.intersectionObserver_.observe(this.$.bodyBottomMarker);
+ this.intersectionObserver_.observe(bottomMarker);
+ this.intersectionObserver_.observe(topMarker);
}
},
« no previous file with comments | « ui/webui/resources/cr_elements/cr_dialog/cr_dialog.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698