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

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

Issue 2758863004: [MD settings] hide scrollbar during animation to subpage (Closed)
Patch Set: moved subpage animating check to current route changed 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/basic_page/basic_page.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_page/main_page_behavior.js
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
index 8fdf5f7e6e61f2e949d67e6f8acaa3df9fce936d..f7f5c6aba46f4797c03dc6e4524657005c52edd0 100644
--- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js
+++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -11,6 +11,16 @@
var MainPageBehaviorImpl = {
properties: {
/**
+ * Help CSS to alter style during the horizontal swipe animation.
+ * Note that this is unrelated to the |currentAnimation_| (which refers to
+ * the vertical exapand animation).
+ */
+ isSubpageAnimating: {
+ reflectToAttribute: true,
+ type: Boolean,
+ },
+
+ /**
* Whether a search operation is in progress or previous search results are
* being displayed.
* @private {boolean}
@@ -25,6 +35,10 @@ var MainPageBehaviorImpl = {
/** @type {?HTMLElement} The scrolling container. */
scroller: null,
+ listeners: {
+ 'neon-animation-finish': 'onNeonAnimationFinish_'
+ },
+
/** @override */
attached: function() {
if (this.domHost && this.domHost.parentNode.tagName == 'PAPER-HEADER-PANEL')
@@ -34,6 +48,15 @@ var MainPageBehaviorImpl = {
},
/**
+ * Remove the is-animating attribute once the animation is complete.
+ * This may catch unrelated animations finishing.
+ * @private
+ */
+ onNeonAnimationFinish_: function() {
+ this.isSubpageAnimating = false;
+ },
+
+ /**
* @param {!settings.Route} newRoute
* @param {settings.Route} oldRoute
*/
@@ -57,6 +80,11 @@ var MainPageBehaviorImpl = {
!settings.lastRouteChangeWasPopstate() || oldRouteWasSection ||
oldRoute == settings.Route.BASIC;
+ if (oldRoute && newRoute == settings.Route.SITE_SETTINGS &&
+ settings.Route.SITE_SETTINGS.contains(oldRoute)) {
Dan Beam 2017/03/18 00:23:24 can you do this without accessing specific routes
dschuyler 2017/03/18 00:49:59 Excellent point. Done.
+ this.isSubpageAnimating = true;
+ }
+
// For previously uncreated pages (including on first load), allow the page
// to render before scrolling to or expanding the section.
if (!oldRoute || this.scrollHeight == 0)
« no previous file with comments | « chrome/browser/resources/settings/basic_page/basic_page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698