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

Side by Side Diff: chrome/browser/resources/options/supervised_user_import.js

Issue 1060333002: Supervised user import dialog: disable "ok" button when no user is selected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698