toggle buttons on row click
This commit is contained in:
parent
c1787b71b7
commit
5662badc50
6
static/allowances.js
Normal file
6
static/allowances.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
$(function() {
|
||||||
|
$(".controls").hide();
|
||||||
|
$(".name").click(function(e) {
|
||||||
|
$(this).next(".controls").toggle();
|
||||||
|
});
|
||||||
|
});
|
@ -17,6 +17,6 @@
|
|||||||
</section>
|
</section>
|
||||||
<script src="/s/jquery-latest.js"></script>
|
<script src="/s/jquery-latest.js"></script>
|
||||||
<script src="/s/bootstrap/js/bootstrap.min.js"></script>
|
<script src="/s/bootstrap/js/bootstrap.min.js"></script>
|
||||||
{{ template "script" . }}
|
<script src="/s/allowances.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{ range .children }}
|
{{ range .children }}
|
||||||
<tr>
|
<tr class="name">
|
||||||
<td class="name">
|
<td>
|
||||||
{{ .Name }}
|
{{ .Name }}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@ -39,14 +39,3 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "script" }}
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$(".controls").hide();
|
|
||||||
$(".name").click(function(e) {
|
|
||||||
console.log(e)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
{{ end }}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user