| 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 2303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 /** | 2314 /** |
| 2315 * Scrolls focused user pod into view. | 2315 * Scrolls focused user pod into view. |
| 2316 */ | 2316 */ |
| 2317 scrollFocusedPodIntoView: function() { | 2317 scrollFocusedPodIntoView: function() { |
| 2318 var pod = this.focusedPod_; | 2318 var pod = this.focusedPod_; |
| 2319 if (!pod) | 2319 if (!pod) |
| 2320 return; | 2320 return; |
| 2321 | 2321 |
| 2322 // First check whether focused pod is already fully visible. | 2322 // First check whether focused pod is already fully visible. |
| 2323 var visibleArea = $('scroll-container'); | 2323 var visibleArea = $('scroll-container'); |
| 2324 // Visible area may not defined at user manager screen on all platforms. |
| 2325 // Windows, Mac and Linux do not have visible area. |
| 2326 if (!visibleArea) |
| 2327 return; |
| 2324 var scrollTop = visibleArea.scrollTop; | 2328 var scrollTop = visibleArea.scrollTop; |
| 2325 var clientHeight = visibleArea.clientHeight; | 2329 var clientHeight = visibleArea.clientHeight; |
| 2326 var podTop = $('oobe').offsetTop + pod.offsetTop; | 2330 var podTop = $('oobe').offsetTop + pod.offsetTop; |
| 2327 var padding = USER_POD_KEYBOARD_MIN_PADDING; | 2331 var padding = USER_POD_KEYBOARD_MIN_PADDING; |
| 2328 if (podTop + pod.height + padding <= scrollTop + clientHeight && | 2332 if (podTop + pod.height + padding <= scrollTop + clientHeight && |
| 2329 podTop - padding >= scrollTop) { | 2333 podTop - padding >= scrollTop) { |
| 2330 return; | 2334 return; |
| 2331 } | 2335 } |
| 2332 | 2336 |
| 2333 // Scroll so that user pod is as centered as possible. | 2337 // Scroll so that user pod is as centered as possible. |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3148 if (pod && pod.multiProfilesPolicyApplied) { | 3152 if (pod && pod.multiProfilesPolicyApplied) { |
| 3149 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 3153 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 3150 } | 3154 } |
| 3151 } | 3155 } |
| 3152 }; | 3156 }; |
| 3153 | 3157 |
| 3154 return { | 3158 return { |
| 3155 PodRow: PodRow | 3159 PodRow: PodRow |
| 3156 }; | 3160 }; |
| 3157 }); | 3161 }); |
| OLD | NEW |