Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: ui/login/account_picker/md_user_pod_row.js

Issue 2875513002: Single user pod implementation for new login screen (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/login/account_picker/md_user_pod_row.js
diff --git a/ui/login/account_picker/md_user_pod_row.js b/ui/login/account_picker/md_user_pod_row.js
index cff4f544fb4623cc771de5eaeefab5df9be51bb1..1bc0e45aef3510939e58c81bcc086d01eaa3ce51 100644
--- a/ui/login/account_picker/md_user_pod_row.js
+++ b/ui/login/account_picker/md_user_pod_row.js
@@ -48,12 +48,12 @@ cr.define('login', function() {
* Variables used for pod placement processing. Width and height should be
* synced with computed CSS sizes of pods.
*/
- var CROS_POD_WIDTH = 180;
+ var CROS_POD_WIDTH = 306;
var DESKTOP_POD_WIDTH = 180;
var MD_DESKTOP_POD_WIDTH = 160;
var PUBLIC_EXPANDED_BASIC_WIDTH = 500;
var PUBLIC_EXPANDED_ADVANCED_WIDTH = 610;
- var CROS_POD_HEIGHT = 213;
+ var CROS_POD_HEIGHT = 346;
var DESKTOP_POD_HEIGHT = 226;
var MD_DESKTOP_POD_HEIGHT = 200;
var POD_ROW_PADDING = 10;
@@ -3935,6 +3935,8 @@ cr.define('login', function() {
this.placePods_();
this.maybePreselectPod();
}
+
+ this.updatePodNameArea();
},
/**
@@ -3963,6 +3965,21 @@ cr.define('login', function() {
}
},
+ /**
+ * Makes sure user name is centered in each pod and extra long name
+ * does not exceed max width.
+ */
+ updatePodNameArea: function() {
+ this.querySelectorAll('.name-container').forEach(function(nameArea) {
+ var nameElement = nameArea.children[1];
jdufault 2017/05/10 00:40:07 Use a more specific selector?
Wenzhao (Colin) Zang 2017/05/11 18:13:36 Done.
+ var leftMargin = (CROS_POD_WIDTH - nameElement.offsetWidth) / 2;
+ if (leftMargin > 0)
+ nameArea.style.left = leftMargin + 'px';
+ else
+ nameElement.style.width = CROS_POD_WIDTH + 'px';
+ });
+ },
+
/**
* Preselects pod, if needed.
*/

Powered by Google App Engine
This is Rietveld 408576698