Chromium Code Reviews| Index: ui/login/account_picker/user_pod_row.js |
| diff --git a/ui/login/account_picker/user_pod_row.js b/ui/login/account_picker/user_pod_row.js |
| index 0027539c251c7c9d745b89b4aa20ee1039acd24a..ac87243a91eb68d51240fe5641ee0f0a97af06dd 100644 |
| --- a/ui/login/account_picker/user_pod_row.js |
| +++ b/ui/login/account_picker/user_pod_row.js |
| @@ -59,9 +59,8 @@ cr.define('login', function() { |
| var POD_ROW_PADDING = 10; |
| var DESKTOP_ROW_PADDING = 32; |
| var CUSTOM_ICON_CONTAINER_SIZE = 40; |
| - var CROS_PIN_POD_WIDTH = 270; |
| - var CROS_PIN_POD_HEIGHT = 594; |
| - var PIN_EXTRA_WIDTH = 90; |
| + var CROS_PIN_POD_WIDTH = 180; |
|
jdufault
2016/08/05 21:58:52
Can we eliminate this variable entirely, or set it
sammiequon
2016/08/05 23:34:50
Done.
|
| + var CROS_PIN_POD_HEIGHT = 417; |
| /** |
| * Minimal padding between user pod and virtual keyboard. |
| @@ -2395,6 +2394,9 @@ cr.define('login', function() { |
| // True if inside focusPod(). |
| insideFocusPod_: false, |
| + // Whether the pin keyboard has been loaded. |
| + pinKeyboardLoaded_: false, |
| + |
| // Focused pod. |
| focusedPod_: undefined, |
| @@ -2550,6 +2552,7 @@ cr.define('login', function() { |
| }, |
| setFocusedPodPinVisibility: function(visible) { |
| + this.pinKeyboardLoaded_ = true; |
|
jdufault
2016/08/05 21:58:52
Can we just query the DOM and see if there is cont
sammiequon
2016/08/05 23:34:50
Done. For multiple pods we want the keyboard to ex
|
| if (this.focusedPod_ && this.focusedPod_.user.showPin) |
| this.focusedPod_.setPinVisibility(visible); |
| }, |
| @@ -2965,28 +2968,6 @@ cr.define('login', function() { |
| }, |
| /** |
| - * Calculates the row and column of the given |pod|. |
| - * @param {UserPod} pod Pod we want the row and column of. |
| - * @param {number} columns Columns in the podrow. |
| - * @param {number} rows Rows in the podrow. |
| - * @return {{columns: number, rows: number}} |
| - * @private |
| - */ |
| - findPodLocation_: function(pod, columns, rows) { |
| - var column = -1; |
| - var row = -1; |
| - var index = this.pods.indexOf(pod); |
| - if (index >= 0) { |
| - row = Math.floor(index / columns); |
| - column = index % columns; |
| - } |
| - else { |
| - console.error('Pod not found in pod row.'); |
| - } |
| - return {column: column, row: row}; |
| - }, |
| - |
| - /** |
| * Places pods onto their positions onto pod grid. |
| * @private |
| */ |
| @@ -3028,16 +3009,10 @@ cr.define('login', function() { |
| } |
| var column = index % columns; |
| var row = Math.floor(index / columns); |
| - var offsetFromPin = 0; |
| - if (row == pinPodLocation.row) { |
| - offsetFromPin = PIN_EXTRA_WIDTH / 2; |
| - if (column <= pinPodLocation.column) |
| - offsetFromPin *= -1; |
| - } |
| var rowPadding = isDesktopUserManager ? DESKTOP_ROW_PADDING : |
| POD_ROW_PADDING; |
| - pod.left = rowPadding + column * (width + margin) + offsetFromPin; |
| + pod.left = rowPadding + column * (width + margin); |
| // On desktop, we want the rows to always be equally spaced. |
| pod.top = isDesktopUserManager ? row * (height + rowPadding) : |
| @@ -3126,7 +3101,9 @@ cr.define('login', function() { |
| var hadFocus = !!this.focusedPod_; |
| this.focusedPod_ = podToFocus; |
| if (podToFocus) { |
| - this.setFocusedPodPinVisibility(true); |
| + // Only show the keyboard if it is fully loaded. |
| + if (this.pinKeyboardLoaded_) |
| + podToFocus.setPinVisibility(true); |
| podToFocus.classList.remove('faded'); |
| podToFocus.classList.add('focused'); |
| if (!podToFocus.multiProfilesPolicyApplied) { |
| @@ -3149,7 +3126,6 @@ cr.define('login', function() { |
| this.scrollFocusedPodIntoView(); |
| } |
| this.insideFocusPod_ = false; |
| - this.placePods_(); |
| }, |
|
jdufault
2016/08/05 21:58:52
Why the removal?
sammiequon
2016/08/05 23:34:50
This was added to support multiple pods and to re
|
| /** |