From 17edb5b85553faee5df2070c99950160a0d9fb89 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Wed, 28 May 2014 19:08:15 +0300 Subject: Save data not yet working --- templates/home.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/templates/home.html b/templates/home.html index 505acda..0651aa0 100644 --- a/templates/home.html +++ b/templates/home.html @@ -16,6 +16,16 @@ }; function save_data(data) { + + $('.light-channel').each(function(_, channel) { + channel = $(channel); + channel.find('.light-row').each(function(_, row) { + var vals = $(row).find('.light-cell-btn').map(function(x) { return $(x).hasClass('active') ? 1 : 0; }); + console.log(_.values(vals)); + }); + console.log(channel.attr('data-light-channel')); + }); + $.ajax({ type: 'POST', contentType: 'application/json', @@ -41,13 +51,22 @@ $('.light-channel').hide(); $('.light-channel[data-light-channel=' + chan +']').show(); }); + + $('#save-btn').click(function(){ + save_data(); + }); });

Light Loop Pi

-
+
-- cgit v1.3.1