Chromium Code Reviews| Index: chrome/browser/resources/options/import_data_overlay.js |
| diff --git a/chrome/browser/resources/options/import_data_overlay.js b/chrome/browser/resources/options/import_data_overlay.js |
| index 600c9fa89b86771285d54a8b8d55779bd1d8caa0..7786f231463e9a449182b3d32810cdb9c2f6570c 100644 |
| --- a/chrome/browser/resources/options/import_data_overlay.js |
| +++ b/chrome/browser/resources/options/import_data_overlay.js |
| @@ -20,6 +20,14 @@ cr.define('options', function() { |
| cr.addSingletonGetter(ImportDataOverlay); |
| + /** |
| + * Returns true if import checkbox for a type is visible and checked. |
|
Dan Beam
2014/10/08 21:36:23
@param {string} type The type of data to import. U
Gaja
2014/10/10 05:19:30
Done.
|
| + */ |
| + function importable(type) { |
| + var id = 'import-' + type; |
| + return $(id + '-with-label').style.display != 'none' && $(id).checked; |
| + } |
| + |
| ImportDataOverlay.prototype = { |
| // Inherit from Page. |
| __proto__: Page.prototype, |
| @@ -75,9 +83,9 @@ cr.define('options', function() { |
| */ |
| validateCommitButton_: function() { |
| var somethingToImport = |
| - $('import-history').checked || $('import-favorites').checked || |
| - $('import-passwords').checked || $('import-search').checked || |
| - $('import-autofill-form-data').checked; |
| + importable('history') || importable('favorites') || |
| + importable('passwords') || importable('search') || |
| + importable('autofill-form-data'); |
| $('import-data-commit').disabled = !somethingToImport; |
| $('import-choose-file').disabled = !$('import-favorites').checked; |
| }, |