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..2027ac4e46bcb53bd1700af3ed5b79ead7adeda4 100644 |
--- a/chrome/browser/resources/options/import_data_overlay.js |
+++ b/chrome/browser/resources/options/import_data_overlay.js |
@@ -20,6 +20,15 @@ cr.define('options', function() { |
cr.addSingletonGetter(ImportDataOverlay); |
+ /** |
+ * @param {string} type The type of data to import. Used in the element's ID. |
+ */ |
+ function importable(type) { |
+ var el = 'import-' + type; |
+ return $(el).checked && |
+ getComputedStyle($(el + '-with-label')).display != 'none'; |
Dan Beam
2014/10/15 03:41:35
fine, but use hidden instead
var id = 'import-'
Gaja
2014/10/15 05:10:51
Done.
|
+ } |
+ |
ImportDataOverlay.prototype = { |
// Inherit from Page. |
__proto__: Page.prototype, |
@@ -75,9 +84,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; |
}, |