| 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 3848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3859 if (leftMargin > 0) | 3859 if (leftMargin > 0) |
| 3860 nameArea.style.left = cr.ui.toCssPx(leftMargin); | 3860 nameArea.style.left = cr.ui.toCssPx(leftMargin); |
| 3861 else { | 3861 else { |
| 3862 pod.nameElement.style.width = cr.ui.toCssPx(CROS_POD_WIDTH); | 3862 pod.nameElement.style.width = cr.ui.toCssPx(CROS_POD_WIDTH); |
| 3863 nameArea.style.left = cr.ui.toCssPx(0); | 3863 nameArea.style.left = cr.ui.toCssPx(0); |
| 3864 } | 3864 } |
| 3865 // Update action box menu position to ensure it doesn't overlap with | 3865 // Update action box menu position to ensure it doesn't overlap with |
| 3866 // elements outside the pod. | 3866 // elements outside the pod. |
| 3867 var actionBoxMenu = pod.querySelector('.action-box-menu'); | 3867 var actionBoxMenu = pod.querySelector('.action-box-menu'); |
| 3868 var actionBoxButton = pod.querySelector('.action-box-button'); | 3868 var actionBoxButton = pod.querySelector('.action-box-button'); |
| 3869 var MENU_TOP_PADDING = 7; | |
| 3870 actionBoxMenu.style.top = | 3869 actionBoxMenu.style.top = |
| 3871 cr.ui.toCssPx(actionBoxButton.offsetHeight + MENU_TOP_PADDING); | 3870 cr.ui.toCssPx(actionBoxButton.offsetHeight); |
| 3872 if (this.isPortraitMode_() && pods.length > 1) { | 3871 if (this.isPortraitMode_() && pods.length > 1) { |
| 3873 // Confine the menu inside the pod when it may overlap with outside | 3872 // Confine the menu inside the pod when it may overlap with outside |
| 3874 // elements. | 3873 // elements. |
| 3875 actionBoxMenu.style.left = 'auto'; | 3874 actionBoxMenu.style.left = 'auto'; |
| 3876 actionBoxMenu.style.right = cr.ui.toCssPx(0); | 3875 actionBoxMenu.style.right = cr.ui.toCssPx(0); |
| 3877 } else { | 3876 } else { |
| 3878 actionBoxMenu.style.left = cr.ui.toCssPx( | 3877 actionBoxMenu.style.left = cr.ui.toCssPx( |
| 3879 pod.nameElement.offsetWidth + actionBoxButton.style.marginLeft); | 3878 pod.nameElement.offsetWidth + actionBoxButton.style.marginLeft); |
| 3880 actionBoxMenu.style.right = 'auto'; | 3879 actionBoxMenu.style.right = 'auto'; |
| 3881 } | 3880 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3979 * Displays a banner containing |message|. If the banner is already present | 3978 * Displays a banner containing |message|. If the banner is already present |
| 3980 * this function updates the message in the banner. | 3979 * this function updates the message in the banner. |
| 3981 * The positioning of the banner is handled by handleAfterPodPlacement_() | 3980 * The positioning of the banner is handled by handleAfterPodPlacement_() |
| 3982 * becuase it dynamically depends on the pod positions. | 3981 * becuase it dynamically depends on the pod positions. |
| 3983 * @param {string} message Text to be displayed or empty to hide the banner. | 3982 * @param {string} message Text to be displayed or empty to hide the banner. |
| 3984 */ | 3983 */ |
| 3985 showBannerMessage: function(message) { | 3984 showBannerMessage: function(message) { |
| 3986 var banner = $('signin-banner'); | 3985 var banner = $('signin-banner'); |
| 3987 banner.textContent = message; | 3986 banner.textContent = message; |
| 3988 banner.classList.toggle('message-set', !!message); | 3987 banner.classList.toggle('message-set', !!message); |
| 3988 $('signin-banner-container1').hidden = banner.textContent.length == 0; |
| 3989 }, | 3989 }, |
| 3990 | 3990 |
| 3991 /** | 3991 /** |
| 3992 * Whether the pod is currently focused. | 3992 * Whether the pod is currently focused. |
| 3993 * @param {UserPod} pod Pod to check for focus. | 3993 * @param {UserPod} pod Pod to check for focus. |
| 3994 * @return {boolean} Pod focus status. | 3994 * @return {boolean} Pod focus status. |
| 3995 */ | 3995 */ |
| 3996 isFocused: function(pod) { | 3996 isFocused: function(pod) { |
| 3997 return this.focusedPod_ == pod; | 3997 return this.focusedPod_ == pod; |
| 3998 }, | 3998 }, |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4500 if (pod && pod.multiProfilesPolicyApplied) { | 4500 if (pod && pod.multiProfilesPolicyApplied) { |
| 4501 pod.userTypeBubbleElement.classList.remove('bubble-shown'); | 4501 pod.userTypeBubbleElement.classList.remove('bubble-shown'); |
| 4502 } | 4502 } |
| 4503 } | 4503 } |
| 4504 }; | 4504 }; |
| 4505 | 4505 |
| 4506 return { | 4506 return { |
| 4507 PodRow: PodRow | 4507 PodRow: PodRow |
| 4508 }; | 4508 }; |
| 4509 }); | 4509 }); |
| OLD | NEW |