Remove unneeded wrapping of jQuery object

Avoid unneeded generating of hidden field
This commit is contained in:
Marc Delisle
2011-01-23 07:18:09 -05:00
parent 8cbee94e5d
commit ac1bdef784

View File

@@ -85,9 +85,12 @@ $(document).ready(function() {
event.preventDefault();
PMA_ajaxShowMessage(PMA_messages['strCopyingDatabase']);
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
$form = $(this);
if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true" />');
}
$.get($(this).attr('action'), $(this).serialize(), function(data) {
$.get($form.attr('action'), $form.serialize(), function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
if( $("#checkbox_switch").is(":checked")) {