Skip to content

Commit 697fb6d

Browse files
committed
--
1 parent 69f1764 commit 697fb6d

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

assets/static/js/app.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
$('#confirmAction').on('show.bs.modal', function (event) {
22

3-
var button = $(event.relatedTarget);
4-
var action = button.data('action');
3+
var button = $(event.relatedTarget);
54

6-
$(this).find('.modal-content form').on('submit', function(event) {
5+
$(this).find('.modal-content form').attr('action', button.data('action'));
6+
});
77

8-
$.ajax({
9-
method : 'POST',
10-
url : action,
11-
data : $(this).serialize(),
12-
dataType : 'json',
13-
success : function(data, event) {
14-
location.reload(true);
15-
},
16-
error: function(request, status, error) {
17-
18-
switch (request.status) {
19-
case 403:
20-
alert("Authentication failed");
21-
break;
22-
default:
23-
alert(error);
24-
break;
25-
}
26-
}
27-
});
8+
$('#confirmAction').find('.modal-content form').on('submit', function(event) {
289

29-
return false
10+
$.ajax({
11+
method : 'POST',
12+
url : $(this).attr('action'),
13+
data : $(this).serialize(),
14+
dataType : 'json',
15+
success : function(data, event) {
16+
location.reload(true);
17+
},
18+
error: function(request, status, error) {
19+
20+
switch (request.status) {
21+
case 403:
22+
alert("Authentication failed");
23+
break;
24+
default:
25+
alert(error);
26+
break;
27+
}
28+
}
3029
});
31-
});
3230

31+
return false
32+
});

0 commit comments

Comments
 (0)