Skip to content

Commit

Permalink
Merge pull request #12 from Paqmind/DEV-714-GETMethodForAjaxAutoreload
Browse files Browse the repository at this point in the history
DEV-714 support for triggering change with GET method on submit of an…
  • Loading branch information
yashikagarg13 committed Nov 25, 2015
2 parents d0eb2a4 + dc59704 commit c33f9c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ $(function () {
event.preventDefault();
var $form = $(this).closest('form');
var $submit = $form.find('button[type="submit"]');
var $method = $form.data('api-method');

// To prevent multisending
var currentButtonHtml = Freya.disableSubmitBtn($submit);
Expand All @@ -149,7 +150,7 @@ $(function () {

function handle() {
$.ajax({
type: $form.attr('method'),
type: $form.data('api-action') ? $method : $form.attr('method'),
url: $form.data('api-action') || $form.attr('action'),
data: formData,
})
Expand Down

0 comments on commit c33f9c4

Please sign in to comment.