Passed
Push — master ( 990d8e...12ba88 )
by Stefan
08:26
created

web/admin/js/eapSorter.js   A

Size

Lines of Code 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 1
rs 10
noi 4
1
/*
2
 * ******************************************************************************
3
 * Copyright 2011-2017 DANTE Ltd. and GÉANT on behalf of the GN3, GN3+, GN4-1 
4
 * and GN4-2 consortia
5
 *
6
 * License: see the web/copyright.php file in the file structure
7
 * ******************************************************************************
8
 */
9
10
$(function () {
11
    $("#sortable1, #sortable2").sortable({
12
        connectWith: "ol.eapmethods",
13
        tolerance: 'pointer',
14
        out: function (event, ui) {
15
            ui.item.toggleClass("eap1");
16
        },
17
        stop: function (event, ui) {
0 ignored issues
show
Unused Code introduced by
The parameter event is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter ui is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
18
            $(".eapm").removeAttr('value');
19
            $(".eapmv").removeAttr('value');
20
            $("#sortable1").children().each(function (index) {
21
                i = index + 1;
0 ignored issues
show
Bug introduced by
The variable i seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.i.
Loading history...
22
                v = $(this).html();
0 ignored issues
show
Bug introduced by
The variable v seems to be never declared. Assigning variables without defining them first makes them global. If this was intended, consider making it explicit like using window.v.
Loading history...
23
                $("#EAP-" + v).val(v);
24
                $("#EAP-" + v + "-priority").val(i);
25
            });
26
        }
27
    }).disableSelection();
28
});
29