Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Lines | 22 |
Ratio | 100 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | View Code Duplication | $('i.glyphicon-refresh-animate').hide(); |
|
30 | function search(target) { |
||
31 | var $list = $('select.list[data-target="' + target + '"]'); |
||
32 | $list.html(''); |
||
33 | var q = $('.search[data-target="' + target + '"]').val(); |
||
34 | |||
35 | var groups = { |
||
36 | role: [$('<optgroup label="Roles">'), false], |
||
37 | permission: [$('<optgroup label="Permission">'), false], |
||
38 | route: [$('<optgroup label="Routes">'), false], |
||
39 | }; |
||
40 | $.each(_opts.items[target], function (name, group) { |
||
41 | if (name.indexOf(q) >= 0) { |
||
42 | $('<option>').text(name).val(name).appendTo(groups[group][0]); |
||
43 | groups[group][1] = true; |
||
44 | } |
||
45 | }); |
||
46 | $.each(groups, function () { |
||
47 | if (this[1]) { |
||
48 | $list.append(this[0]); |
||
49 | } |
||
50 | }); |
||
51 | } |
||
52 | |||
56 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.