Moved the jQuery script for handling Create Table action from

js/db_operations.js to js/functions.js as this action is used on
multiple pages.
This commit is contained in:
ninadsp
2010-06-25 11:01:19 +05:30
parent 217968fb92
commit dcdde2f99f
2 changed files with 35 additions and 31 deletions

View File

@@ -1935,4 +1935,35 @@ $(document).ready(function() {
})
})
}, 'top.frame_content'); //end $(document).ready() for db_structure.php
}, 'top.frame_content'); //end $(document).ready() for db_structure.php
/**
* jQuery coding for 'Create Table'. Used on db_operations.php,
* db_structure.php and db_tracking.php (i.e., wherever
* libraries/display_create_table.lib.php is used)
*/
$(document).ready(function() {
$("#create_table_form_minimal").live('submit', function(event) {
event.preventDefault();
/* @todo Validate this form! */
PMA_ajaxShowMessage();
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
$.get($(this).attr('action'), $(this).serialize(), function(data) {
$('<div id="create_table_dialog"></div>')
.append(data)
.dialog({
title: PMA_messages['strCreateTable'],
width: 900,
buttons : {
"Create Table" : function() {
$('#create_table_form').trigger("submit");
},
"Cancel" : function() {$(this).dialog('close').remove() ;}
}
});
})
})
}, 'top.frame_content');