Total Complexity | 7 |
Complexity/F | 1 |
Lines of Code | 57 |
Function Count | 7 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /*! |
||
7 | (function (sx, $, _) { |
||
|
|||
8 | sx.createNamespace('classes', sx); |
||
9 | |||
10 | sx.classes.DualSelect = sx.classes.Component.extend({ |
||
11 | |||
12 | _init: function () { |
||
13 | |||
14 | }, |
||
15 | |||
16 | _onDomReady: function () { |
||
17 | var self = this; |
||
18 | |||
19 | this.jWrapper = $("#" + this.get('id')); |
||
20 | |||
21 | this.jHidden = $(".sx-sortable-hidden", this.jWrapper); |
||
22 | this.jVisible = $(".sx-sortable-visible", this.jWrapper); |
||
23 | |||
24 | this.jElement = $(".sx-select-element", this.jWrapper); |
||
25 | |||
26 | this.jHidden.sortable({ |
||
27 | //items: "li:not(.ui-state-disabled)" |
||
28 | connectWith: "." + this.get('id') + "-conncected", |
||
29 | dropOnEmpty: false, |
||
30 | out: function() { |
||
31 | self._update(); |
||
32 | } |
||
33 | }); |
||
34 | |||
35 | this.jVisible.sortable({ |
||
36 | /*cancel: ".ui-state-disabled",*/ |
||
37 | connectWith: "." + this.get('id') + "-conncected", |
||
38 | dropOnEmpty: false, |
||
39 | out: function() { |
||
40 | self._update(); |
||
41 | } |
||
42 | }); |
||
43 | }, |
||
44 | |||
45 | _update: function () { |
||
46 | var self = this; |
||
47 | |||
48 | this.jElement.empty(); |
||
49 | |||
50 | $('li', this.jVisible).each(function() { |
||
51 | self.jElement.append( |
||
52 | $('<option>', { |
||
53 | 'selected' : 'selected', |
||
54 | 'value' : $(this).data('value') |
||
55 | }).append($(this).text()) |
||
56 | ) |
||
57 | }); |
||
58 | |||
59 | this.trigger('change'); |
||
60 | this.jElement.change(); |
||
61 | } |
||
62 | }); |
||
63 | })(sx, sx.$, sx._); |
||
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.