toggle buttons on row click

This commit is contained in:
Stephen McQuay 2013-03-05 23:26:57 -08:00
parent c1787b71b7
commit 5662badc50
3 changed files with 9 additions and 14 deletions

6
static/allowances.js Normal file
View File

@ -0,0 +1,6 @@
$(function() {
$(".controls").hide();
$(".name").click(function(e) {
$(this).next(".controls").toggle();
});
});

View File

@ -17,6 +17,6 @@
</section>
<script src="/s/jquery-latest.js"></script>
<script src="/s/bootstrap/js/bootstrap.min.js"></script>
{{ template "script" . }}
<script src="/s/allowances.js"></script>
</body>
</html>

View File

@ -16,8 +16,8 @@
</thead>
<tbody>
{{ range .children }}
<tr>
<td class="name">
<tr class="name">
<td>
{{ .Name }}
</td>
<td>
@ -39,14 +39,3 @@
</table>
</div>
{{ end }}
{{ define "script" }}
<script>
$(function() {
$(".controls").hide();
$(".name").click(function(e) {
console.log(e)
});
});
</script>
{{ end }}