MCPcopy Create free account
hub / github.com/davisking/dlib / Toggle

Function Toggle

docs/docs/dlib.js:16–54  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

14// --------------------------------------------------------------
15
16function Toggle(node)
17{
18 // Unfold the branch if it isn't visible
19 var next_node = node.nextSibling;
20 if (next_node.style.display == 'none')
21 {
22 // Change the image (if there is an image)
23 if (node.childNodes.length > 0)
24 {
25 if (node.childNodes.length > 0)
26 {
27 if (node.childNodes.item(0).nodeName == "IMG")
28 {
29 node.childNodes.item(0).src = "minus.gif";
30 }
31 }
32 }
33
34 next_node.style.display = 'block';
35 }
36 // Collapse the branch if it IS visible
37 else
38 {
39 // Change the image (if there is an image)
40 if (node.childNodes.length > 0)
41 {
42 if (node.childNodes.length > 0)
43 {
44 if (node.childNodes.item(0).nodeName == "IMG")
45 {
46 node.childNodes.item(0).src = "plus.gif";
47 }
48 }
49 }
50
51 next_node.style.display = 'none';
52 }
53
54}
55function BigToggle(node)
56{
57 // Unfold the branch if it isn't visible

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected