diff --git a/js/export.js b/js/export.js index f34536a2c..166e65555 100644 --- a/js/export.js +++ b/js/export.js @@ -118,7 +118,7 @@ $(document).ready(function() { }); /** - * For SQL plugin, if "CREATE TABLE options" is checked/uncheck, check/uncheck each of its sub-options + * For SQL plugin, if "CREATE TABLE options" is checked/unchecked, check/uncheck each of its sub-options */ $(document).ready(function() { $("#checkbox_sql_create_table_statements").change(function() { @@ -154,8 +154,7 @@ $(document).ready(function() { */ $(document).ready(function() { $("input[type='radio'][name='quick_or_custom']").change(function() { - export_type = $("input[type='radio'][name='quick_or_custom']:checked").attr("value"); - if(export_type == "custom") { + if($("$(this):checked").attr("value") == "custom") { $("#databases_and_tables").show(); $("#rows").show(); $("#output").show(); @@ -180,6 +179,7 @@ $(document).ready(function() { $(document).ready(function() { $("#quick_or_custom").show(); $("#databases_and_tables").hide(); + $("#rows").hide(); $("#output_quick_export").show(); $("#output").hide(); $("#format_specific_opts").hide(); @@ -187,4 +187,24 @@ $(document).ready(function() { $(".format_specific_options").hide(); $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0}); $(".format_specific_options h3").remove(); +}); + +/** + * Disables the "Dump some row(s)" sub-options when it is not selected + */ + $(document).ready(function() { + $("input[type='radio'][name='allrows']").change(function() { +// alert(("$(this):checked").attr("name")); + if($("input[type='radio'][name='allrows']:checked").attr("value") == "1") { + $("label[for='limit_to']").fadeTo('fast', 0.4); + $("label[for='limit_from']").fadeTo('fast', 0.4); + $("input[type='text'][name='limit_to']").attr('disabled', 'disabled'); + $("input[type='text'][name='limit_from']").attr('disabled', 'disabled'); + } else { + $("label[for='limit_to']").fadeTo('fast', 1); + $("label[for='limit_from']").fadeTo('fast', 1); + $("input[type='text'][name='limit_to']").removeAttr('disabled'); + $("input[type='text'][name='limit_from']").removeAttr('disabled'); + } + }); }); \ No newline at end of file