Conditions | 1 |
Paths | 1 |
Total Lines | 49 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | (function() { |
||
2 | 'use strict'; |
||
3 | |||
4 | // The namespace |
||
5 | /** @namespace faulancer.core.debugoutput */ |
||
6 | var ns = faulancer.namespace('core.debugoutput'); |
||
7 | |||
8 | var _eventHandler = { |
||
9 | |||
10 | onStackClick: function() { |
||
11 | |||
12 | document.querySelectorAll('.stack').forEach(function(item) { |
||
13 | item.style.display = 'none'; |
||
14 | }); |
||
15 | |||
16 | document.querySelectorAll('.previousStack').forEach(function(item) { |
||
17 | item.classList.remove('selected'); |
||
18 | }); |
||
19 | |||
20 | this.classList.add('selected'); |
||
21 | |||
22 | document.getElementById(this.dataset.stackIdentifier).style.display = 'block'; |
||
23 | |||
24 | } |
||
25 | |||
26 | }; |
||
27 | |||
28 | // Public scope |
||
29 | ns = { |
||
30 | |||
31 | init: function() { |
||
32 | |||
33 | var stacks = document.querySelectorAll('.previousStack'); |
||
34 | |||
35 | stacks.forEach(function(item, i) { |
||
36 | |||
37 | if (i !== 0) { |
||
38 | item.classList.remove('selected'); |
||
39 | } |
||
40 | |||
41 | item.addEventListener('click', _eventHandler.onStackClick); |
||
42 | }); |
||
43 | |||
44 | } |
||
45 | |||
46 | }; |
||
47 | |||
48 | window.addEventListener('load', ns.init()); |
||
49 | })(); |
||
50 |
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.