OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 Out of the box experience flow (OOBE). | 6 * @fileoverview Out of the box experience flow (OOBE). |
7 * This is the main code for the OOBE WebUI implementation. | 7 * This is the main code for the OOBE WebUI implementation. |
8 */ | 8 */ |
9 | 9 |
10 var localStrings = new LocalStrings(); | 10 var localStrings = new LocalStrings(); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 } else { | 130 } else { |
131 // Start fading animation for login display. | 131 // Start fading animation for login display. |
132 oldStep.classList.add('faded'); | 132 oldStep.classList.add('faded'); |
133 newStep.classList.remove('faded'); | 133 newStep.classList.remove('faded'); |
134 } | 134 } |
135 | 135 |
136 // Adjust inner container height based on new step's height. | 136 // Adjust inner container height based on new step's height. |
137 $('inner-container').style.height = newStep.offsetHeight + 'px'; | 137 $('inner-container').style.height = newStep.offsetHeight + 'px'; |
138 | 138 |
139 if (this.currentStep_ != nextStepIndex) { | 139 if (this.currentStep_ != nextStepIndex && |
| 140 !oldStep.classList.contains('hidden')) { |
140 oldStep.addEventListener('webkitTransitionEnd', function f(e) { | 141 oldStep.addEventListener('webkitTransitionEnd', function f(e) { |
141 oldStep.removeEventListener('webkitTransitionEnd', f); | 142 oldStep.removeEventListener('webkitTransitionEnd', f); |
142 oldStep.classList.add('hidden'); | 143 oldStep.classList.add('hidden'); |
143 }); | 144 }); |
144 } else { | 145 } else { |
145 // First screen on OOBE launch. | 146 // First screen on OOBE launch. |
146 newHeader.classList.remove('right'); | 147 newHeader.classList.remove('right'); |
147 } | 148 } |
148 this.currentStep_ = nextStepIndex; | 149 this.currentStep_ = nextStepIndex; |
149 $('oobe').className = nextStepId; | 150 $('oobe').className = nextStepId; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 this.appendButtons_(screen.buttons); | 218 this.appendButtons_(screen.buttons); |
218 } | 219 } |
219 }, | 220 }, |
220 | 221 |
221 /** | 222 /** |
222 * Prepares screens to use in login display. | 223 * Prepares screens to use in login display. |
223 */ | 224 */ |
224 prepareForLoginDisplay_ : function() { | 225 prepareForLoginDisplay_ : function() { |
225 for (var i = 0, screenId; screenId = this.screens_[i]; ++i) { | 226 for (var i = 0, screenId; screenId = this.screens_[i]; ++i) { |
226 var screen = $(screenId); | 227 var screen = $(screenId); |
227 | |
228 screen.classList.add('faded'); | 228 screen.classList.add('faded'); |
229 screen.classList.remove('right'); | 229 screen.classList.remove('right'); |
230 screen.classList.remove('left'); | 230 screen.classList.remove('left'); |
231 } | 231 } |
232 } | 232 } |
233 }; | 233 }; |
234 | 234 |
235 /** | 235 /** |
236 * Setups given "select" element using the list and adds callback. | 236 * Setups given "select" element using the list and adds callback. |
237 * @param {!Element} select Select object to be updated. | 237 * @param {!Element} select Select object to be updated. |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 document.onselectstart = function(e) { | 574 document.onselectstart = function(e) { |
575 e.preventDefault(); | 575 e.preventDefault(); |
576 } | 576 } |
577 | 577 |
578 // Disable dragging. | 578 // Disable dragging. |
579 document.ondragstart = function(e) { | 579 document.ondragstart = function(e) { |
580 e.preventDefault(); | 580 e.preventDefault(); |
581 } | 581 } |
582 | 582 |
583 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); | 583 document.addEventListener('DOMContentLoaded', cr.ui.Oobe.initialize); |
OLD | NEW |