Total Complexity | 3 |
Complexity/F | 1 |
Lines of Code | 33 |
Function Count | 3 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | 'use strict'; |
||
2 | |||
3 | $(document).ready(function () { |
||
4 | |||
5 | let $locality = $('#property_locality'); |
||
6 | let $title = $('#property_title'); |
||
7 | let $description = $('#property_description'); |
||
8 | let $address = $('#property_address'); |
||
9 | let $content = $('#property_content'); |
||
10 | |||
11 | $locality.change(function () { |
||
12 | |||
13 | let $form = $(this).closest('form'); |
||
14 | let data = {}; |
||
15 | data[$locality.attr('name')] = $locality.val(); |
||
16 | data[$title.attr('name')] = $title.val(); |
||
17 | data[$description.attr('name')] = $description.val(); |
||
18 | data[$address.attr('name')] = $address.val(); |
||
19 | data[$content.attr('name')] = $content.val(); |
||
20 | |||
21 | $.ajax({ |
||
22 | url: $form.attr('action'), |
||
23 | type: $form.attr('method'), |
||
24 | data: data, |
||
25 | success: function (html) { |
||
26 | $('#property_area').replaceWith( |
||
27 | $(html).find('#property_area') |
||
28 | ); |
||
29 | } |
||
30 | }); |
||
31 | }); |
||
32 | |||
33 | }); |
||
34 |