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 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 if (this.querySelector('.language-select').multipleRecommendedLocales) | 2014 if (this.querySelector('.language-select').multipleRecommendedLocales) |
2015 this.classList.add('advanced'); | 2015 this.classList.add('advanced'); |
2016 this.usualLeft = this.left; | 2016 this.usualLeft = this.left; |
2017 this.makeSpaceForExpandedPod_(); | 2017 this.makeSpaceForExpandedPod_(); |
2018 } else if (typeof(this.usualLeft) != 'undefined') { | 2018 } else if (typeof(this.usualLeft) != 'undefined') { |
2019 this.left = this.usualLeft; | 2019 this.left = this.usualLeft; |
2020 } | 2020 } |
2021 | 2021 |
2022 var self = this; | 2022 var self = this; |
2023 this.classList.add('animating'); | 2023 this.classList.add('animating'); |
2024 this.addEventListener('webkitTransitionEnd', function f(e) { | 2024 this.addEventListener('transitionend', function f(e) { |
2025 self.removeEventListener('webkitTransitionEnd', f); | 2025 self.removeEventListener('transitionend', f); |
2026 self.classList.remove('animating'); | 2026 self.classList.remove('animating'); |
2027 | 2027 |
2028 // Accessibility focus indicator does not move with the focused | 2028 // Accessibility focus indicator does not move with the focused |
2029 // element. Sends a 'focus' event on the currently focused element | 2029 // element. Sends a 'focus' event on the currently focused element |
2030 // so that accessibility focus indicator updates its location. | 2030 // so that accessibility focus indicator updates its location. |
2031 if (document.activeElement) | 2031 if (document.activeElement) |
2032 document.activeElement.dispatchEvent(new Event('focus')); | 2032 document.activeElement.dispatchEvent(new Event('focus')); |
2033 }); | 2033 }); |
2034 // Guard timer set to animation duration + 20ms. | 2034 // Guard timer set to animation duration + 20ms. |
2035 ensureTransitionEndEvent(this, 200); | 2035 ensureTransitionEndEvent(this, 200); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 * Transition the expanded pod from the basic to the advanced view. | 2228 * Transition the expanded pod from the basic to the advanced view. |
2229 */ | 2229 */ |
2230 transitionToAdvanced_: function() { | 2230 transitionToAdvanced_: function() { |
2231 var pod = this; | 2231 var pod = this; |
2232 var languageAndInputSection = | 2232 var languageAndInputSection = |
2233 this.querySelector('.language-and-input-section'); | 2233 this.querySelector('.language-and-input-section'); |
2234 this.classList.add('transitioning-to-advanced'); | 2234 this.classList.add('transitioning-to-advanced'); |
2235 setTimeout(function() { | 2235 setTimeout(function() { |
2236 pod.classList.add('advanced'); | 2236 pod.classList.add('advanced'); |
2237 pod.makeSpaceForExpandedPod_(); | 2237 pod.makeSpaceForExpandedPod_(); |
2238 languageAndInputSection.addEventListener('webkitTransitionEnd', | 2238 languageAndInputSection.addEventListener('transitionend', |
2239 function observer() { | 2239 function observer() { |
2240 languageAndInputSection.removeEventListener('webkitTransitionEnd', | 2240 languageAndInputSection.removeEventListener('transitionend', |
2241 observer); | 2241 observer); |
2242 pod.classList.remove('transitioning-to-advanced'); | 2242 pod.classList.remove('transitioning-to-advanced'); |
2243 pod.querySelector('.language-select').focus(); | 2243 pod.querySelector('.language-select').focus(); |
2244 }); | 2244 }); |
2245 // Guard timer set to animation duration + 20ms. | 2245 // Guard timer set to animation duration + 20ms. |
2246 ensureTransitionEndEvent(languageAndInputSection, 380); | 2246 ensureTransitionEndEvent(languageAndInputSection, 380); |
2247 }, 0); | 2247 }, 0); |
2248 }, | 2248 }, |
2249 | 2249 |
2250 /** | 2250 /** |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3653 setTimeout(function() { | 3653 setTimeout(function() { |
3654 Oobe.getInstance().toggleClass('flying-pods', true); | 3654 Oobe.getInstance().toggleClass('flying-pods', true); |
3655 if (focusedPod) | 3655 if (focusedPod) |
3656 ensureTransitionEndEvent(focusedPod); | 3656 ensureTransitionEndEvent(focusedPod); |
3657 }, 0); | 3657 }, 0); |
3658 | 3658 |
3659 // Force input focus for user pod on show and once transition ends. | 3659 // Force input focus for user pod on show and once transition ends. |
3660 if (focusedPod) { | 3660 if (focusedPod) { |
3661 var screen = this.parentNode; | 3661 var screen = this.parentNode; |
3662 var self = this; | 3662 var self = this; |
3663 focusedPod.addEventListener('webkitTransitionEnd', function f(e) { | 3663 focusedPod.addEventListener('transitionend', function f(e) { |
3664 focusedPod.removeEventListener('webkitTransitionEnd', f); | 3664 focusedPod.removeEventListener('transitionend', f); |
3665 focusedPod.reset(true); | 3665 focusedPod.reset(true); |
3666 // Notify screen that it is ready. | 3666 // Notify screen that it is ready. |
3667 screen.onShow(); | 3667 screen.onShow(); |
3668 }); | 3668 }); |
3669 } | 3669 } |
3670 }, | 3670 }, |
3671 | 3671 |
3672 /** | 3672 /** |
3673 * Called right before the pod row is shown. | 3673 * Called right before the pod row is shown. |
3674 */ | 3674 */ |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3725 if (pod && pod.multiProfilesPolicyApplied) { | 3725 if (pod && pod.multiProfilesPolicyApplied) { |
3726 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3726 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
3727 } | 3727 } |
3728 } | 3728 } |
3729 }; | 3729 }; |
3730 | 3730 |
3731 return { | 3731 return { |
3732 PodRow: PodRow | 3732 PodRow: PodRow |
3733 }; | 3733 }; |
3734 }); | 3734 }); |
OLD | NEW |