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

Unified Diff: chrome/browser/resources/chromeos/login/oobe.js

Issue 7541047: CrOS OOBE: Fix OOBE step CSS class updating when jumping. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/oobe.js
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js
index 6212e301479c0947b1b47cc096ac40471928e425..be299572ac2e9fb93a0cd0dde3c070e1296a5dc2 100644
--- a/chrome/browser/resources/chromeos/login/oobe.js
+++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -77,6 +77,26 @@ cr.define('cr.ui', function() {
},
/**
+ * Updates a step's css classes to reflect left, current, or right position.
+ * @param {number} stepIndex step index.
+ * @param {state} state one of 'left', 'current', 'right'.
xiyuan 2011/08/05 19:51:29 nit: {string}
Mattias Nissler (ping if slow) 2011/08/08 11:23:40 Done.
+ */
+ updateStep_: function(stepIndex, state) {
+ var stepId = this.screens_[stepIndex];
+ var step = $(stepId);
+ var header = $('header-' + stepId);
+ var states = [ 'left', 'right', 'current' ];
+ for (var i = 0; i < states.length; ++i) {
+ if (states[i] != state) {
+ step.classList.remove(states[i]);
+ header.classList.remove(states[i]);
+ }
+ }
+ step.classList.add(state);
+ header.classList.add(state);
+ },
+
+ /**
* Switches to the next OOBE step.
* @param {number} nextStepIndex Index of the next step.
*/
@@ -84,7 +104,6 @@ cr.define('cr.ui', function() {
var currentStepId = this.screens_[this.currentStep_];
var nextStepId = this.screens_[nextStepIndex];
var oldStep = $(currentStepId);
- var oldHeader = $('header-' + currentStepId);
var newStep = $(nextStepId);
var newHeader = $('header-' + nextStepId);
@@ -96,15 +115,13 @@ cr.define('cr.ui', function() {
if (Oobe.isOobeUI()) {
// Start gliding animation for OOBE steps.
if (nextStepIndex > this.currentStep_) {
- oldHeader.classList.add('left');
- oldStep.classList.add('left');
- newHeader.classList.remove('right');
- newStep.classList.remove('right');
+ for (var i = this.currentStep_; i < nextStepIndex; ++i)
+ this.updateStep_(i, 'left');
+ this.updateStep_(nextStepIndex, 'current');
} else if (nextStepIndex < this.currentStep_) {
- oldHeader.classList.add('right');
- oldStep.classList.add('right');
- newHeader.classList.remove('left');
- newStep.classList.remove('left');
+ for (var i = this.currentStep_; i > nextStepIndex; --i)
+ this.updateStep_(i, 'right');
+ this.updateStep_(nextStepIndex, 'current');
}
} else {
// Start fading animation for login display.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698