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

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

Issue 8341139: Options: Fix to enable Edit button only when the current profile is selected. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 6
7 var OptionsPage = options.OptionsPage; 7 var OptionsPage = options.OptionsPage;
8 var ArrayDataModel = cr.ui.ArrayDataModel; 8 var ArrayDataModel = cr.ui.ArrayDataModel;
9 9
10 // State variables. 10 // State variables.
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 /** 216 /**
217 * Helper function to set the status of profile view buttons to disabled or 217 * Helper function to set the status of profile view buttons to disabled or
218 * enabled, depending on the number of profiles and selection status of the 218 * enabled, depending on the number of profiles and selection status of the
219 * profiles list. 219 * profiles list.
220 */ 220 */
221 setProfileViewButtonsStatus_: function() { 221 setProfileViewButtonsStatus_: function() {
222 var profilesList = $('profiles-list'); 222 var profilesList = $('profiles-list');
223 var selectedProfile = profilesList.selectedItem; 223 var selectedProfile = profilesList.selectedItem;
224 var hasSelection = selectedProfile != null; 224 var hasSelection = selectedProfile != null;
225 var hasSingleProfile = profilesList.dataModel.length == 1; 225 var hasSingleProfile = profilesList.dataModel.length == 1;
226 $('profiles-manage').disabled = !hasSelection; 226 $('profiles-manage').disabled = !hasSelection ||
227 !selectedProfile.isCurrentProfile;
227 $('profiles-delete').disabled = !hasSelection || hasSingleProfile; 228 $('profiles-delete').disabled = !hasSelection || hasSingleProfile;
228 }, 229 },
229 230
230 /** 231 /**
231 * Display the correct dialog layout, depending on how many profiles are 232 * Display the correct dialog layout, depending on how many profiles are
232 * available. 233 * available.
233 * @param {number} numProfiles The number of profiles to display. 234 * @param {number} numProfiles The number of profiles to display.
234 */ 235 */
235 setProfileViewSingle_: function(numProfiles) { 236 setProfileViewSingle_: function(numProfiles) {
236 var hasSingleProfile = numProfiles == 1; 237 var hasSingleProfile = numProfiles == 1;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 PersonalOptions.getInstance()[name + '_'](value); 349 PersonalOptions.getInstance()[name + '_'](value);
349 }; 350 };
350 }); 351 });
351 352
352 // Export 353 // Export
353 return { 354 return {
354 PersonalOptions: PersonalOptions 355 PersonalOptions: PersonalOptions
355 }; 356 };
356 357
357 }); 358 });
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