From aef391032f23b3fa66e6da3be33ebbc04877a997 Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Fri, 19 Apr 2013 11:23:44 +0530 Subject: [PATCH 1/2] Fixed #3883 Export > Custom > Dump some rows : input fields are disabled --- js/export.js | 37 +++++++++++++++++++++++++++++-------- 1 file 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 @@ -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'); +} From feaad54ef5e377267dca63527dea383c6d2e5327 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Fri, 19 Apr 2013 11:53:32 +0530 Subject: [PATCH 2/2] Properly disable text fields in Chrome --- js/export.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/export.js b/js/export.js index 3b5095bb5e..979b84724e 100644 --- a/js/export.js +++ b/js/export.js @@ -241,8 +241,8 @@ 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); + $("input[type='text'][name='limit_to']").prop('disabled', 'disabled'); + $("input[type='text'][name='limit_from']").prop('disabled', 'disabled'); } /** @@ -252,6 +252,6 @@ 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'); + $("input[type='text'][name='limit_to']").prop('disabled', ''); + $("input[type='text'][name='limit_from']").prop('disabled', ''); }