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

Side by Side Diff: chrome/browser/resources/settings/settings_page/settings_animated_pages.js

Issue 2249873003: Settings: Fix Site Details subpage routing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment typo 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-animated-pages' is a container for a page and animated subpages. 7 * 'settings-animated-pages' is a container for a page and animated subpages.
8 * It provides a set of common behaviors and animations. 8 * It provides a set of common behaviors and animations.
9 * 9 *
10 * Example: 10 * Example:
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // Don't manipulate the light DOM until it's ready. 85 // Don't manipulate the light DOM until it's ready.
86 if (!this.lightDomReady_) { 86 if (!this.lightDomReady_) {
87 this.queuedRouteChange_ = this.queuedRouteChange_ || {oldRoute: oldRoute}; 87 this.queuedRouteChange_ = this.queuedRouteChange_ || {oldRoute: oldRoute};
88 this.queuedRouteChange_.newRoute = newRoute; 88 this.queuedRouteChange_.newRoute = newRoute;
89 return; 89 return;
90 } 90 }
91 91
92 this.ensureSubpageInstance_(); 92 this.ensureSubpageInstance_();
93 93
94 if (oldRoute) { 94 if (oldRoute) {
95 if (oldRoute.isSubpage() && oldRoute.contains(newRoute)) { 95 if (oldRoute.isSubpage() && newRoute.depth > oldRoute.depth) {
96 // Slide left for a descendant subpage. 96 // Slide left for a deeper subpage.
97 this.$.animatedPages.exitAnimation = 'slide-left-animation'; 97 this.$.animatedPages.exitAnimation = 'slide-left-animation';
98 this.$.animatedPages.entryAnimation = 'slide-from-right-animation'; 98 this.$.animatedPages.entryAnimation = 'slide-from-right-animation';
99 } else if (newRoute.contains(oldRoute)) { 99 } else if (oldRoute.depth > newRoute.depth) {
100 // Slide right for an ancestor subpage. 100 // Slide right for a shallower subpage.
101 this.$.animatedPages.exitAnimation = 'slide-right-animation'; 101 this.$.animatedPages.exitAnimation = 'slide-right-animation';
102 this.$.animatedPages.entryAnimation = 'slide-from-left-animation'; 102 this.$.animatedPages.entryAnimation = 'slide-from-left-animation';
103 } else { 103 } else {
104 // The old route is not a subpage or is at the same level, so just fade. 104 // The old route is not a subpage or is at the same level, so just fade.
105 this.$.animatedPages.exitAnimation = 'fade-out-animation'; 105 this.$.animatedPages.exitAnimation = 'fade-out-animation';
106 this.$.animatedPages.entryAnimation = 'fade-in-animation'; 106 this.$.animatedPages.entryAnimation = 'fade-in-animation';
107 107
108 if (!oldRoute.isSubpage()) { 108 if (!oldRoute.isSubpage()) {
109 // Set the height the expand animation should start at before 109 // Set the height the expand animation should start at before
110 // beginning the transition to the new subpage. 110 // beginning the transition to the new subpage.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 // instance, such that the stamped instance will also be ignored by the 144 // instance, such that the stamped instance will also be ignored by the
145 // searching algorithm. 145 // searching algorithm.
146 if (template.hasAttribute('no-search')) 146 if (template.hasAttribute('no-search'))
147 subpage.setAttribute('no-search', ''); 147 subpage.setAttribute('no-search', '');
148 148
149 // Render synchronously so neon-animated-pages can select the subpage. 149 // Render synchronously so neon-animated-pages can select the subpage.
150 template.if = true; 150 template.if = true;
151 template.render(); 151 template.render();
152 }, 152 },
153 }); 153 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/route.js ('k') | chrome/browser/resources/settings/settings_page/settings_subpage.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698