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

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

Issue 1642323004: User Manager MD User Pods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments, fixed google colors Created 4 years, 9 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/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 c36496d08a4a503ebf0f7d286d8951430160ce45..70d8a8b96874579d5b5e55418899fe8bd76d72b5 100644
--- a/ui/login/account_picker/user_pod_row.js
+++ b/ui/login/account_picker/user_pod_row.js
@@ -28,7 +28,7 @@ cr.define('login', function() {
* @type {Array<number>}
* @const
*/
- var DESKTOP_MARGIN_BY_COLUMNS = [undefined, 15, 15, 15, 15, 15, 15];
+ var DESKTOP_MARGIN_BY_COLUMNS = [undefined, 32, 32, 32, 32, 32, 32];
/**
* Maximal number of columns currently supported by pod-row.
@@ -48,13 +48,14 @@ cr.define('login', function() {
* Variables used for pod placement processing. Width and height should be
* synced with computed CSS sizes of pods.
*/
- var POD_WIDTH = 180;
+ var CROS_POD_WIDTH = 180;
+ var DESKTOP_POD_WIDTH = 160;
var PUBLIC_EXPANDED_BASIC_WIDTH = 500;
var PUBLIC_EXPANDED_ADVANCED_WIDTH = 610;
var CROS_POD_HEIGHT = 213;
- var DESKTOP_POD_HEIGHT = 226;
+ var DESKTOP_POD_HEIGHT = 200;
var POD_ROW_PADDING = 10;
- var DESKTOP_ROW_PADDING = 15;
+ var DESKTOP_ROW_PADDING = 32;
var CUSTOM_ICON_CONTAINER_SIZE = 40;
/**
@@ -1549,20 +1550,14 @@ cr.define('login', function() {
return;
// Add localized messages where $1 will be replaced with
// <span class="total-count"></span>.
+ // and $2 will be replaced with <span class="email"></span>.
+ message = message.replace('$1', '<span class="total-count">'+ count +
Dan Beam 2016/03/25 02:48:23 space between end of string and +
Moe 2016/04/04 14:55:09 Done.
+ '</span>');
+ message = message.replace('$2', '<span class="email">'+
+ this.user.emailAddress + '</span>');
var element = this.querySelector('.action-box-remove-user-warning-text');
- element.textContent = '';
-
- messageParts = message.split('$1');
- var numParts = messageParts.length;
- for (var j = 0; j < numParts; j++) {
- element.appendChild(document.createTextNode(messageParts[j]));
- if (j < numParts - 1) {
- var elementToAdd = document.createElement('span');
- elementToAdd.classList.add('total-count');
- elementToAdd.textContent = count;
- element.appendChild(elementToAdd);
- }
- }
+ element.innerHTML = message;
+
this.moveActionMenuUpIfNeeded_();
},
@@ -2314,8 +2309,8 @@ cr.define('login', function() {
DISPLAY_TYPE.DESKTOP_USER_MANAGER;
this.userPodHeight_ = isDesktopUserManager ? DESKTOP_POD_HEIGHT :
CROS_POD_HEIGHT;
- // Same for Chrome OS and desktop.
- this.userPodWidth_ = POD_WIDTH;
+ this.userPodWidth_ = isDesktopUserManager ? DESKTOP_POD_WIDTH :
+ CROS_POD_WIDTH;
Dan Beam 2016/03/25 02:48:23 ident funky
Moe 2016/04/04 14:55:09 Done.
},
/**
@@ -2782,6 +2777,8 @@ cr.define('login', function() {
* @return {{columns: number, rows: number}}
*/
calculateLayout_: function() {
+ var isDesktopUserManager = Oobe.getInstance().displayType ==
+ DISPLAY_TYPE.DESKTOP_USER_MANAGER;
var preferredColumns = this.pods.length < COLUMNS.length ?
COLUMNS[this.pods.length] : COLUMNS[COLUMNS.length - 1];
var maxWidth = Oobe.getInstance().clientAreaSize.width;
@@ -2793,9 +2790,11 @@ cr.define('login', function() {
$('signin-banner'), null).getPropertyValue('display') != 'none') {
rows = Math.min(rows, MAX_NUMBER_OF_ROWS_UNDER_SIGNIN_BANNER);
}
- var maxHeigth = Oobe.getInstance().clientAreaSize.height;
- while (maxHeigth < this.rowsToHeight_(rows) && rows > 1)
- --rows;
+ if (!isDesktopUserManager) {
+ var maxHeigth = Oobe.getInstance().clientAreaSize.height;
+ while (maxHeigth < this.rowsToHeight_(rows) && rows > 1)
+ --rows;
+ }
// One more iteration if it's not enough cells to place all pods.
while (maxWidth >= this.columnsToWidth_(columns + 1) &&
columns * rows < this.pods.length &&

Powered by Google App Engine
This is Rietveld 408576698