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

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

Issue 1290583002: Settings: Implement sub-subpages, and clean up some animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_page/settings_animated_pages.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
index 634a329a9ee80f7eec79f778a07a2b8f0bfc64e1..bafd9554444a669cbb1ff2ba4e9a6afd27925c5a 100644
--- a/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
+++ b/chrome/browser/resources/settings/settings_page/settings_animated_pages.js
@@ -21,24 +21,6 @@ Polymer({
is: 'cr-settings-animated-pages',
properties: {
- /**
- * Corresponds to a page id.
- */
- selectedPage: {
- type: String,
- value: 'main',
- },
-
- entryAnimation: {
- type: String,
- value: 'next-page-enter-animation',
- },
-
- exitAnimation: {
- type: String,
- value: 'next-page-exit-animation',
- },
-
inSubpage: {
type: Boolean,
notify: true,
@@ -50,19 +32,38 @@ Polymer({
this.history_ = ['main'];
},
+ /** @private */
inSubpageChanged_: function() {
this.classList.toggle('in-subpage', this.inSubpage);
},
navigateTo: function(page) {
+ if (this.inSubpage) {
+ this.$.animatedPages.exitAnimation = 'slide-left-animation';
+ this.$.animatedPages.entryAnimation = 'slide-from-right-animation';
+ } else {
+ this.$.animatedPages.exitAnimation = 'settings-fade-out-animation';
+ this.$.animatedPages.entryAnimation = 'settings-fade-in-animation';
+ }
+
this.history_.push(page);
this.inSubpage = true;
- this.selectedPage = page;
+
+ this.$.animatedPages.selected = page;
},
back: function() {
this.history_.pop();
this.inSubpage = this.history_.length > 1;
- this.selectedPage = this.history_.slice(-1)[0];
+
+ if (this.inSubpage) {
+ this.$.animatedPages.exitAnimation = 'slide-right-animation';
+ this.$.animatedPages.entryAnimation = 'slide-from-left-animation';
+ } else {
+ this.$.animatedPages.exitAnimation = 'settings-fade-out-animation';
+ this.$.animatedPages.entryAnimation = 'settings-fade-in-animation';
+ }
+
+ this.$.animatedPages.selected = this.history_.slice(-1)[0];
},
});

Powered by Google App Engine
This is Rietveld 408576698