From b43375b735f7ae2e29ea83a2ba5ef10d7b3fc639 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 9 Nov 2010 07:55:55 -0500 Subject: [PATCH] remove unneeded wrapper for jQuery objects; do not generate ajax_request hidden field more than once --- js/functions.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/js/functions.js b/js/functions.js index 4ccafed20..8bd944957 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1671,12 +1671,14 @@ $(document).ready(function() { /** * @var the_form object referring to the create table form */ - var the_form = $("#create_table_form"); + var $form = $("#create_table_form"); PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); - $(the_form).append(''); + if (! $form.find('input:hidden').is('#ajax_request_hidden')) { + $form.append(''); + } //User wants to submit the form - $.post($(the_form).attr('action'), $(the_form).serialize() + "&do_save_data=" + $(this).val(), function(data) { + $.post($form.attr('action'), $form.serialize() + "&do_save_data=" + $(this).val(), function(data) { if(data.success == true) { PMA_ajaxShowMessage(data.message); $("#create_table_dialog").dialog("close").remove(); @@ -1749,13 +1751,15 @@ $(document).ready(function() { /** * @var the_form object referring to the create table form */ - var the_form = $("#create_table_form"); + var $form = $("#create_table_form"); PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']); - $(the_form).append(''); + if (! $form.find('input:hidden').is('#ajax_request_hidden')) { + $form.append(''); + } //User wants to add more fields to the table - $.post($(the_form).attr('action'), $(the_form).serialize() + "&submit_num_fields=" + $(this).val(), function(data) { + $.post($form.attr('action'), $form.serialize() + "&submit_num_fields=" + $(this).val(), function(data) { $("#create_table_dialog").html(data); }) //end $.post()