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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var Page = cr.ui.pageManager.Page; | 6 var Page = cr.ui.pageManager.Page; |
7 var PageManager = cr.ui.pageManager.PageManager; | 7 var PageManager = cr.ui.pageManager.PageManager; |
8 var ArrayDataModel = cr.ui.ArrayDataModel; | 8 var ArrayDataModel = cr.ui.ArrayDataModel; |
9 | 9 |
10 /** | 10 /** |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 this.inProgress_ = inProgress; | 168 this.inProgress_ = inProgress; |
169 $('supervised-user-import-ok').disabled = inProgress; | 169 $('supervised-user-import-ok').disabled = inProgress; |
170 $('supervised-user-select-avatar-ok').disabled = inProgress; | 170 $('supervised-user-select-avatar-ok').disabled = inProgress; |
171 $('supervised-user-list').disabled = inProgress; | 171 $('supervised-user-list').disabled = inProgress; |
172 $('select-avatar-grid').disabled = inProgress; | 172 $('select-avatar-grid').disabled = inProgress; |
173 $('supervised-user-import-throbber').hidden = !inProgress; | 173 $('supervised-user-import-throbber').hidden = !inProgress; |
174 }, | 174 }, |
175 | 175 |
176 /** | 176 /** |
177 * Sets the data model of the supervised user list to |supervisedUsers|. | 177 * Sets the data model of the supervised user list to |supervisedUsers|. |
178 * @param {Array.<{id: string, name: string, iconURL: string, | 178 * @param {Array<{id: string, name: string, iconURL: string, |
179 * onCurrentDevice: boolean, needAvatar: boolean}>} supervisedUsers | 179 * onCurrentDevice: boolean, needAvatar: boolean}>} supervisedUsers |
180 * Array of supervised user objects. | 180 * Array of supervised user objects. |
181 * @private | 181 * @private |
182 */ | 182 */ |
183 receiveExistingSupervisedUsers_: function(supervisedUsers) { | 183 receiveExistingSupervisedUsers_: function(supervisedUsers) { |
184 supervisedUsers.sort(function(a, b) { | 184 supervisedUsers.sort(function(a, b) { |
185 if (a.onCurrentDevice != b.onCurrentDevice) | 185 if (a.onCurrentDevice != b.onCurrentDevice) |
186 return a.onCurrentDevice ? 1 : -1; | 186 return a.onCurrentDevice ? 1 : -1; |
187 return a.name.localeCompare(b.name); | 187 return a.name.localeCompare(b.name); |
188 }); | 188 }); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 cr.makePublic(SupervisedUserImportOverlay, [ | 233 cr.makePublic(SupervisedUserImportOverlay, [ |
234 'onError', | 234 'onError', |
235 'onSuccess', | 235 'onSuccess', |
236 ]); | 236 ]); |
237 | 237 |
238 // Export | 238 // Export |
239 return { | 239 return { |
240 SupervisedUserImportOverlay: SupervisedUserImportOverlay, | 240 SupervisedUserImportOverlay: SupervisedUserImportOverlay, |
241 }; | 241 }; |
242 }); | 242 }); |
OLD | NEW |