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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_section.js

Issue 2825203003: MD Settings: Remove subpage animation when landing directly on it. (Closed)
Patch Set: nits Created 3 years, 7 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
Index: chrome/browser/resources/settings/settings_page/settings_section.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_section.js b/chrome/browser/resources/settings/settings_page/settings_section.js
index 0fe5074c402cd2e6589aa2f8336bd544e71b4466..a2914618175b8707bcec34d7a8ec5f1b7debbb92 100644
--- a/chrome/browser/resources/settings/settings_page/settings_section.js
+++ b/chrome/browser/resources/settings/settings_page/settings_section.js
@@ -99,6 +99,17 @@ var SettingsSectionElement = Polymer({
!this.classList.contains('expanded') && this.$.card.clientHeight > 0;
},
+ immediateExpand: function(container) {
+ // Target position is the container's top edge in the viewport.
+ var containerTop = container.getBoundingClientRect().top;
+
+ this.$.card.position = 'fixed';
+ this.$.card.top = containerTop + 'px';
+ this.$.card.height = 'calc(100% - ' + containerTop + 'px)';
+
+ this.classList.add('expanded');
+ },
+
/**
* Animates the section expanding to fill the container. The section is fixed
* in the viewport during the animation, making it safe to adjust the rest of

Powered by Google App Engine
This is Rietveld 408576698