static/midcom.admin.folder/jquery-postfix.js   A
last analyzed

Complexity

Total Complexity 6
Complexity/F 1

Size

Lines of Code 18
Function Count 6

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 11
mnd 0
bc 0
fnc 6
dl 0
loc 18
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
1
$(document).ready(function() {
2
    $('#midcom_admin_folder_order_form_sort_type select').on('change', function() {
3
        let form = $(this).closest('form');
4
        $('#midcom_admin_folder_order_form').addClass('loading');
5
        $.post(form.attr('action') + '?ajax', form.serialize(), function(data) {
6
            $('#midcom_admin_folder_order_form').removeClass('loading');
7
            $('#midcom_admin_folder_order_form_wrapper').html(data);
8
        });
9
    });
10
11
    $('#midcom_admin_folder_order_form').on('submit', function() {
12
        $(this).find('ul').each(function() {
13
            $(this).find('li').each(function(i) {
14
                $(this).find('input').val(i);
15
            });
16
        });
17
    });
18
});
19