Fixed #3883 Export > Custom > Dump some rows : input fields are disabled

This commit is contained in:
Spun Nakandala 2013-04-19 11:23:44 +05:30 committed by Madhura Jayaratne
parent 6415c03d67
commit aef391032f

View File

@ -217,20 +217,41 @@ AJAX.registerOnload('export.js', function () {
toggle_structure_data_opts($("select#plugins").val());
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');
}