diff options
| author | Yuval Adam <yuv.adm@gmail.com> | 2014-05-28 16:05:00 +0300 |
|---|---|---|
| committer | Yuval Adam <yuv.adm@gmail.com> | 2014-05-28 16:05:00 +0300 |
| commit | fb7fd6c29d25c6259334b08479f4ff2db89f0526 (patch) | |
| tree | 74a80c4d4006d9560510158d9415a7e35bba41b9 /templates | |
| parent | 47762976ab1048b227c45fb2359c31c748b45fa1 (diff) | |
Show one channel each time
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/home.html | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/templates/home.html b/templates/home.html index b6e76bf..505acda 100644 --- a/templates/home.html +++ b/templates/home.html @@ -33,6 +33,13 @@ _.each(_.range(CHANNELS), function(i) { var row = $(_.template($('#light-row-template').text(), {i: i, subchannels: SUB_CHANNELS, cells: LOOP_LENGTH})); $('#light-container').append(row); + $('#channel-btns').append($('<button type="button" class="btn btn-default channel-btn" data-channel="' + i + '">Channel ' + i + '</button>')); + }); + + $('.channel-btn').click(function() { + var chan = $(this).attr('data-channel'); + $('.light-channel').hide(); + $('.light-channel[data-light-channel=' + chan +']').show(); }); }); </script> @@ -40,8 +47,11 @@ <body> <div class="container"> <h1>Light Loop Pi</h1> + <div id="channel-btns" class="btn-group"></div> + <div id="light-container"></div> </div> + <script type="text/template" class="template" id="light-row-template"> <div class="light-channel" data-light-channel="<%= i %>"> <h3>Channel <%= i %></h3> |
