Total Complexity | 5 |
Complexity/F | 1.25 |
Lines of Code | 38 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | $(function () { |
||
2 | /* |
||
3 | * APP MODAL |
||
4 | * Monitoramento do smodalname |
||
5 | */ |
||
6 | $(document).on('click', "[smodalname]", function (e) { |
||
7 | e.preventDefault(); |
||
8 | $(this).smodal(); |
||
9 | }); |
||
10 | |||
11 | |||
12 | /* |
||
13 | * APP MODAL |
||
14 | * Monitoramento do data-post fazendo ajax |
||
15 | */ |
||
16 | $(document).on("click", "[data-post]", function (e) { |
||
17 | e.preventDefault(); |
||
18 | |||
19 | var clicked = $(this); |
||
20 | var data = clicked.data(); |
||
21 | |||
22 | $.ajax({ |
||
23 | url: data.post, |
||
24 | type: "POST", |
||
25 | data: data, |
||
26 | dataType: "json", |
||
27 | success: function (response) { |
||
28 | |||
29 | if (response.smodal) { |
||
30 | $(document).smodal(response.smodal); |
||
31 | } |
||
32 | |||
33 | } |
||
34 | }); |
||
35 | }); |
||
36 | |||
37 | |||
38 | }); |