[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_8-10831-gb43375b

Marc Delisle lem9 at users.sourceforge.net
Tue Nov 9 13:56:07 CET 2010


The branch, master has been updated
       via  b43375b735f7ae2e29ea83a2ba5ef10d7b3fc639 (commit)
      from  f7169036bc2bfc29c592a4debc8466e475ccfacf (commit)


- Log -----------------------------------------------------------------
commit b43375b735f7ae2e29ea83a2ba5ef10d7b3fc639
Author: Marc Delisle <marc at infomarc.info>
Date:   Tue Nov 9 07:55:55 2010 -0500

    remove unneeded wrapper for jQuery objects; do not generate ajax_request hidden field more than once

-----------------------------------------------------------------------

Summary of changes:
 js/functions.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/js/functions.js b/js/functions.js
index 4ccafed..8bd9449 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('<input type="hidden" name="ajax_request" value="true" />');
+        if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
+            $form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
+        }
         //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('<input type="hidden" name="ajax_request" value="true" />');
+        if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
+            $form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
+        }
 
         //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()
 


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list