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 cr.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
657 * @private | 657 * @private |
658 */ | 658 */ |
659 setProfileViewButtonsStatus_: function() { | 659 setProfileViewButtonsStatus_: function() { |
660 var profilesList = $('profiles-list'); | 660 var profilesList = $('profiles-list'); |
661 var selectedProfile = profilesList.selectedItem; | 661 var selectedProfile = profilesList.selectedItem; |
662 var hasSelection = selectedProfile != null; | 662 var hasSelection = selectedProfile != null; |
663 var hasSingleProfile = profilesList.dataModel.length == 1; | 663 var hasSingleProfile = profilesList.dataModel.length == 1; |
664 $('profiles-manage').disabled = !hasSelection || | 664 $('profiles-manage').disabled = !hasSelection || |
665 !selectedProfile.isCurrentProfile; | 665 !selectedProfile.isCurrentProfile; |
666 $('profiles-delete').disabled = !hasSelection && !hasSingleProfile; | 666 $('profiles-delete').disabled = !hasSelection && !hasSingleProfile; |
667 var importData = $('import-data'); | |
668 if (importData) { | |
669 importData.disabled = $('import-data').disabled = hasSelection && | |
670 !selectedProfile.isCurrentProfile; | |
Dan Beam
2012/03/01 03:56:20
2 more \s
| |
671 } | |
667 }, | 672 }, |
668 | 673 |
669 /** | 674 /** |
670 * Display the correct dialog layout, depending on how many profiles are | 675 * Display the correct dialog layout, depending on how many profiles are |
671 * available. | 676 * available. |
672 * @param {number} numProfiles The number of profiles to display. | 677 * @param {number} numProfiles The number of profiles to display. |
673 * @private | 678 * @private |
674 */ | 679 */ |
675 setProfileViewSingle_: function(numProfiles) { | 680 setProfileViewSingle_: function(numProfiles) { |
676 var hasSingleProfile = numProfiles == 1; | 681 var hasSingleProfile = numProfiles == 1; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
764 BrowserOptions.getLoggedInUsername = function() { | 769 BrowserOptions.getLoggedInUsername = function() { |
765 return BrowserOptions.getInstance().username_; | 770 return BrowserOptions.getInstance().username_; |
766 }; | 771 }; |
767 } | 772 } |
768 | 773 |
769 // Export | 774 // Export |
770 return { | 775 return { |
771 BrowserOptions: BrowserOptions | 776 BrowserOptions: BrowserOptions |
772 }; | 777 }; |
773 }); | 778 }); |
OLD | NEW |