File tree Expand file tree Collapse file tree 1 file changed +25
-25
lines changed Expand file tree Collapse file tree 1 file changed +25
-25
lines changed Original file line number Diff line number Diff line change 1
1
$ ( '#confirmAction' ) . on ( 'show.bs.modal' , function ( event ) {
2
2
3
- var button = $ ( event . relatedTarget ) ;
4
- var action = button . data ( 'action' ) ;
3
+ var button = $ ( event . relatedTarget ) ;
5
4
6
- $ ( this ) . find ( '.modal-content form' ) . on ( 'submit' , function ( event ) {
5
+ $ ( this ) . find ( '.modal-content form' ) . attr ( 'action' , button . data ( 'action' ) ) ;
6
+ } ) ;
7
7
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 ) {
28
9
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
+ }
30
29
} ) ;
31
- } ) ;
32
30
31
+ return false
32
+ } ) ;
You can’t perform that action at this time.
0 commit comments