Passed
Push — master ( cc7767...b0feda )
by Stefan
11:56
created

eapSorter.js ➔ $   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 14
nc 1
nop 0
dl 0
loc 18
rs 9.7
c 2
b 0
f 0

2 Functions

Rating   Name   Duplication   Size   Complexity  
A eapSorter.js ➔ ... ➔ $(ꞌ#sortable1, #sortable2ꞌ).sortable.out 0 3 1
A eapSorter.js ➔ ... ➔ $(ꞌ#sortable1, #sortable2ꞌ).sortable.stop 0 9 1
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
                var v = $(this).html();
22
                $("#EAP-" + v).val(v);
23
                $("#EAP-" + v + "-priority").val(index + 1);
24
            });
25
        }
26
    }).disableSelection();
27
});
28