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 27 matching lines...) Expand all Loading... |
38 options.supervisedUserOptions.SupervisedUserList.decorate( | 38 options.supervisedUserOptions.SupervisedUserList.decorate( |
39 supervisedUserList); | 39 supervisedUserList); |
40 | 40 |
41 var avatarGrid = $('select-avatar-grid'); | 41 var avatarGrid = $('select-avatar-grid'); |
42 options.ProfilesIconGrid.decorate(avatarGrid); | 42 options.ProfilesIconGrid.decorate(avatarGrid); |
43 var avatarIcons = loadTimeData.getValue('avatarIcons'); | 43 var avatarIcons = loadTimeData.getValue('avatarIcons'); |
44 avatarGrid.dataModel = new ArrayDataModel(avatarIcons); | 44 avatarGrid.dataModel = new ArrayDataModel(avatarIcons); |
45 | 45 |
46 supervisedUserList.addEventListener('change', function(event) { | 46 supervisedUserList.addEventListener('change', function(event) { |
47 var supervisedUser = supervisedUserList.selectedItem; | 47 var supervisedUser = supervisedUserList.selectedItem; |
48 if (!supervisedUser) | |
49 return; | |
50 | |
51 $('supervised-user-import-ok').disabled = | 48 $('supervised-user-import-ok').disabled = |
52 supervisedUserList.selectedItem.onCurrentDevice; | 49 !supervisedUser || supervisedUser.onCurrentDevice; |
53 }); | 50 }); |
54 | 51 |
55 var self = this; | 52 var self = this; |
56 $('supervised-user-import-cancel').onclick = function(event) { | 53 $('supervised-user-import-cancel').onclick = function(event) { |
57 if (self.inProgress_) { | 54 if (self.inProgress_) { |
58 self.updateImportInProgress_(false); | 55 self.updateImportInProgress_(false); |
59 | 56 |
60 // 'cancelCreateProfile' is handled by CreateProfileHandler. | 57 // 'cancelCreateProfile' is handled by CreateProfileHandler. |
61 chrome.send('cancelCreateProfile'); | 58 chrome.send('cancelCreateProfile'); |
62 } | 59 } |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 cr.makePublic(SupervisedUserImportOverlay, [ | 230 cr.makePublic(SupervisedUserImportOverlay, [ |
234 'onError', | 231 'onError', |
235 'onSuccess', | 232 'onSuccess', |
236 ]); | 233 ]); |
237 | 234 |
238 // Export | 235 // Export |
239 return { | 236 return { |
240 SupervisedUserImportOverlay: SupervisedUserImportOverlay, | 237 SupervisedUserImportOverlay: SupervisedUserImportOverlay, |
241 }; | 238 }; |
242 }); | 239 }); |
OLD | NEW |