1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 17:59:21 +02:00

fix ajax post logic to include form elements

This commit is contained in:
John Moore 2013-07-27 17:52:37 -05:00
parent 6b40e833ea
commit a03b53485d
2 changed files with 2 additions and 6 deletions

View file

@ -58,11 +58,6 @@ class Ajax {
$source_txt = "'#$source'"; $source_txt = "'#$source'";
} }
// If it's a post then we need to stop events
if ($post) {
$action = 'Event.stop(e); ' . $action;
}
$observe = "<script type=\"text/javascript\">"; $observe = "<script type=\"text/javascript\">";
$observe .= "$($source_txt).$method(function(e){" . $action . ";});"; $observe .= "$($source_txt).$method(function(e){" . $action . ";});";
$observe .= "</script>"; $observe .= "</script>";

View file

@ -26,7 +26,8 @@ $(document).ajaxComplete(function () {
// ajaxPost // ajaxPost
// Post the contents of a form. // Post the contents of a form.
function ajaxPost(url, input, source) { function ajaxPost(url, input, source) {
$.ajax(url, { success: processContents, type: 'post', data: input }); //$('#' + input)
$.ajax(url, { success: processContents, type: 'post', data: $('#'+input).serialize() });
} // ajaxPost } // ajaxPost
// ajaxPut // ajaxPut