implemented toggling of list headers
This commit is contained in:
parent
915369ed28
commit
a1d08426ce
|
@ -131,10 +131,13 @@ class BServer:
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function showHide(id) {
|
function showHide(id) {
|
||||||
var e = document.getElementById(id);
|
var e = document.getElementById(id);
|
||||||
|
var h = document.getElementById("h-" + id);
|
||||||
if(e.style.display == null || e.style.display == "none") {
|
if(e.style.display == null || e.style.display == "none") {
|
||||||
e.style.display = "block";
|
e.style.display = "block";
|
||||||
|
h.classList.add("open");
|
||||||
} else {
|
} else {
|
||||||
e.style.display = "none";
|
e.style.display = "none";
|
||||||
|
h.classList.remove("open");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function hideargs() {
|
function hideargs() {
|
||||||
|
@ -177,7 +180,7 @@ class BServer:
|
||||||
if not group._group_actions:
|
if not group._group_actions:
|
||||||
continue
|
continue
|
||||||
prefix = getattr(group, "prefix", None)
|
prefix = getattr(group, "prefix", None)
|
||||||
result.append('''<h3 onclick="showHide(%s)">%s</h3>\n<table id="%s">\n''' % (groupid, group.title, groupid))
|
result.append('''<h3 id="h-%s" onclick="showHide(%s)">%s</h3>\n<table id="%s">\n''' % (groupid, groupid, group.title, groupid))
|
||||||
for a in group._group_actions:
|
for a in group._group_actions:
|
||||||
if a.dest in ("input", "output"):
|
if a.dest in ("input", "output"):
|
||||||
continue
|
continue
|
||||||
|
@ -261,7 +264,7 @@ Create boxes and more with a laser cutter!
|
||||||
<div style="width: 100%">
|
<div style="width: 100%">
|
||||||
""" ]
|
""" ]
|
||||||
for nr, group in enumerate(self.groups):
|
for nr, group in enumerate(self.groups):
|
||||||
result.append('''<h3 onclick="showHide('%s')">%s</h3>\n<div id="%s">\n''' % (nr, group.title, nr))
|
result.append('''<h3 id="h-%s" onclick="showHide('%s')">%s</h3>\n<div id="%s">\n''' % (nr, nr, group.title, nr))
|
||||||
result.append("""
|
result.append("""
|
||||||
<div style="width: 20%%; float: right;">
|
<div style="width: 20%%; float: right;">
|
||||||
<img style="width: 100%%;" id="sample-%s" src="static/nothing.png" alt="" />
|
<img style="width: 100%%;" id="sample-%s" src="static/nothing.png" alt="" />
|
||||||
|
|
Loading…
Reference in New Issue