| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 User pod row implementation. | 6 * @fileoverview User pod row implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 cr.define('login', function() { | 9 cr.define('login', function() { |
| 10 /** | 10 /** |
| (...skipping 3225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3236 if (!this.alwaysFocusSinglePod) | 3236 if (!this.alwaysFocusSinglePod) |
| 3237 this.focusPod(); | 3237 this.focusPod(); |
| 3238 break; | 3238 break; |
| 3239 } | 3239 } |
| 3240 }, | 3240 }, |
| 3241 | 3241 |
| 3242 /** | 3242 /** |
| 3243 * Called right after the pod row is shown. | 3243 * Called right after the pod row is shown. |
| 3244 */ | 3244 */ |
| 3245 handleAfterShow: function() { | 3245 handleAfterShow: function() { |
| 3246 var focusedPod = this.focusedPod_; |
| 3247 |
| 3246 // Without timeout changes in pods positions will be animated even though | 3248 // Without timeout changes in pods positions will be animated even though |
| 3247 // it happened when 'flying-pods' class was disabled. | 3249 // it happened when 'flying-pods' class was disabled. |
| 3248 setTimeout(function() { | 3250 setTimeout(function() { |
| 3249 Oobe.getInstance().toggleClass('flying-pods', true); | 3251 Oobe.getInstance().toggleClass('flying-pods', true); |
| 3252 if (focusedPod) |
| 3253 ensureTransitionEndEvent(focusedPod); |
| 3250 }, 0); | 3254 }, 0); |
| 3255 |
| 3251 // Force input focus for user pod on show and once transition ends. | 3256 // Force input focus for user pod on show and once transition ends. |
| 3252 if (this.focusedPod_) { | 3257 if (focusedPod) { |
| 3253 var focusedPod = this.focusedPod_; | |
| 3254 var screen = this.parentNode; | 3258 var screen = this.parentNode; |
| 3255 var self = this; | 3259 var self = this; |
| 3256 focusedPod.addEventListener('webkitTransitionEnd', function f(e) { | 3260 focusedPod.addEventListener('webkitTransitionEnd', function f(e) { |
| 3257 focusedPod.removeEventListener('webkitTransitionEnd', f); | 3261 focusedPod.removeEventListener('webkitTransitionEnd', f); |
| 3258 focusedPod.reset(true); | 3262 focusedPod.reset(true); |
| 3259 // Notify screen that it is ready. | 3263 // Notify screen that it is ready. |
| 3260 screen.onShow(); | 3264 screen.onShow(); |
| 3261 }); | 3265 }); |
| 3262 // Guard timer for 1 second -- it would conver all possible animations. | |
| 3263 ensureTransitionEndEvent(focusedPod, 1000); | |
| 3264 } | 3266 } |
| 3265 }, | 3267 }, |
| 3266 | 3268 |
| 3267 /** | 3269 /** |
| 3268 * Called right before the pod row is shown. | 3270 * Called right before the pod row is shown. |
| 3269 */ | 3271 */ |
| 3270 handleBeforeShow: function() { | 3272 handleBeforeShow: function() { |
| 3271 Oobe.getInstance().toggleClass('flying-pods', false); | 3273 Oobe.getInstance().toggleClass('flying-pods', false); |
| 3272 for (var event in this.listeners_) { | 3274 for (var event in this.listeners_) { |
| 3273 this.ownerDocument.addEventListener( | 3275 this.ownerDocument.addEventListener( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3320 if (pod && pod.multiProfilesPolicyApplied) { | 3322 if (pod && pod.multiProfilesPolicyApplied) { |
| 3321 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3323 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3322 } | 3324 } |
| 3323 } | 3325 } |
| 3324 }; | 3326 }; |
| 3325 | 3327 |
| 3326 return { | 3328 return { |
| 3327 PodRow: PodRow | 3329 PodRow: PodRow |
| 3328 }; | 3330 }; |
| 3329 }); | 3331 }); |
| OLD | NEW |