diff options
author | Spun Nakandala <supun.nakandala@gmail.com> | 2013-04-19 09:53:44 +0400 |
---|---|---|
committer | Spun Nakandala <supun.nakandala@gmail.com> | 2013-04-19 09:53:44 +0400 |
commit | e969e4187acb5856b2c76244ebd434f46316e966 (patch) | |
tree | aa11f8cc1ffc49e082a590f293980f9aeda11982 /js/export.js | |
parent | a9e12ddec72473c1b126f6a13a7b1323d75fceff (diff) |
Fixed #3883 Export > Custom > Dump some rows : input fields are disabled
Diffstat (limited to 'js/export.js')
-rw-r--r-- | js/export.js | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/js/export.js b/js/export.js index 12689e11b7..3b5095bb5e 100644 --- a/js/export.js +++ b/js/export.js @@ -218,19 +218,40 @@ AJAX.registerOnload('export.js', function () { toggle_sql_include_comments(); /** + * Initially disables the "Dump some row(s)" sub-options + */ + disable_dump_some_rows_sub_options(); + + /** * Disables the "Dump some row(s)" sub-options when it is not selected */ $("input[type='radio'][name='allrows']").change(function() { if ($("input[type='radio'][name='allrows']").prop("checked")) { - $("label[for='limit_to']").fadeTo('fast', 0.4); - $("label[for='limit_from']").fadeTo('fast', 0.4); - $("input[type='text'][name='limit_to']").prop('disabled', true); - $("input[type='text'][name='limit_from']").prop('disabled', true); + enable_dump_some_rows_sub_options(); } else { - $("label[for='limit_to']").fadeTo('fast', 1); - $("label[for='limit_from']").fadeTo('fast', 1); - $("input[type='text'][name='limit_to']").removeProp('disabled'); - $("input[type='text'][name='limit_from']").removeProp('disabled'); + disable_dump_some_rows_sub_options(); } }); }); + +/** + * Disables the "Dump some row(s)" sub-options + */ +function disable_dump_some_rows_sub_options() +{ + $("label[for='limit_to']").fadeTo('fast', 0.4); + $("label[for='limit_from']").fadeTo('fast', 0.4); + $("input[type='text'][name='limit_to']").prop('disabled', true); + $("input[type='text'][name='limit_from']").prop('disabled', true); +} + +/** + * Enables the "Dump some row(s)" sub-options + */ +function enable_dump_some_rows_sub_options() +{ + $("label[for='limit_to']").fadeTo('fast', 1); + $("label[for='limit_from']").fadeTo('fast', 1); + $("input[type='text'][name='limit_to']").removeProp('disabled'); + $("input[type='text'][name='limit_from']").removeProp('disabled'); +} |