MCPcopy Create free account
hub / github.com/chigraph/chigraph / toggleFolder

Function toggleFolder

docs/dynsections.js:49–81  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

47}
48
49function toggleFolder(id)
50{
51 // the clicked row
52 var currentRow = $('#row_'+id);
53
54 // all rows after the clicked row
55 var rows = currentRow.nextAll("tr");
56
57 var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
58
59 // only match elements AFTER this one (can't hide elements before)
60 var childRows = rows.filter(function() { return this.id.match(re); });
61
62 // first row is visible we are HIDING
63 if (childRows.filter(':first').is(':visible')===true) {
64 // replace down arrow by right arrow for current row
65 var currentRowSpans = currentRow.find("span");
66 currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
67 currentRowSpans.filter(".arrow").html('►');
68 rows.filter("[id^=row_"+id+"]").hide(); // hide all children
69 } else { // we are SHOWING
70 // replace right arrow by down arrow for current row
71 var currentRowSpans = currentRow.find("span");
72 currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
73 currentRowSpans.filter(".arrow").html('▼');
74 // replace down arrows by right arrows for child rows
75 var childRowsSpans = childRows.find("span");
76 childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
77 childRowsSpans.filter(".arrow").html('►');
78 childRows.show(); //show all children
79 }
80 updateStripes();
81}
82
83
84function toggleInherit(id)

Callers

nothing calls this directly

Calls 1

updateStripesFunction · 0.85

Tested by

no test coverage detected