OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** |
11 * Pod width. 170px Pod + 10px padding + 10px margin on both sides. | |
12 * @type {number} | |
13 * @const | |
14 */ | |
15 var POD_WIDTH = 170 + 2 * (10 + 10); | |
16 | |
17 /** | |
18 * Number of displayed columns depending on user pod count. | 11 * Number of displayed columns depending on user pod count. |
19 * @type {Array.<number>} | 12 * @type {Array.<number>} |
20 * @const | 13 * @const |
21 */ | 14 */ |
22 var COLUMNS = [0, 1, 2, 3, 4, 5, 4, 4, 4, 5, 5, 6, 6, 5, 5, 6, 6, 6, 6]; | 15 var COLUMNS = [0, 1, 2, 3, 4, 5, 4, 4, 4, 5, 5, 6, 6, 5, 5, 6, 6, 6, 6]; |
23 | 16 |
24 /** | 17 /** |
25 * Whether to preselect the first pod automatically on login screen. | 18 * Whether to preselect the first pod automatically on login screen. |
26 * @type {boolean} | 19 * @type {boolean} |
27 * @const | 20 * @const |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 /** | 964 /** |
972 * Resizes the pod row and cancel any pending resize operations. | 965 * Resizes the pod row and cancel any pending resize operations. |
973 * @param {number} columns Number of columns. | 966 * @param {number} columns Number of columns. |
974 * @param {number} rows Number of rows. | 967 * @param {number} rows Number of rows. |
975 * @private | 968 * @private |
976 */ | 969 */ |
977 resize_: function(columns, rows) { | 970 resize_: function(columns, rows) { |
978 this.removeEventListener('mouseout', this.deferredResizeListener_); | 971 this.removeEventListener('mouseout', this.deferredResizeListener_); |
979 this.columns = columns; | 972 this.columns = columns; |
980 this.rows = rows; | 973 this.rows = rows; |
| 974 if (this.parentNode == Oobe.getInstance().currentScreen) { |
| 975 Oobe.getInstance().updateScreenSize(this.parentNode); |
| 976 } |
981 }, | 977 }, |
982 | 978 |
983 /** | 979 /** |
984 * Number of columns. | 980 * Number of columns. |
985 * @type {?number} | 981 * @type {?number} |
986 */ | 982 */ |
987 set columns(columns) { | 983 set columns(columns) { |
988 // Cannot use 'columns' here. | 984 // Cannot use 'columns' here. |
989 this.setAttribute('ncolumns', columns); | 985 this.setAttribute('ncolumns', columns); |
990 }, | 986 }, |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 this.classList.remove('images-loading'); | 1378 this.classList.remove('images-loading'); |
1383 chrome.send('userImagesLoaded'); | 1379 chrome.send('userImagesLoaded'); |
1384 } | 1380 } |
1385 } | 1381 } |
1386 }; | 1382 }; |
1387 | 1383 |
1388 return { | 1384 return { |
1389 PodRow: PodRow | 1385 PodRow: PodRow |
1390 }; | 1386 }; |
1391 }); | 1387 }); |
OLD | NEW |