From bfa9d278fdb69871d0aa5dc720393819034d815f Mon Sep 17 00:00:00 2001 From: chrono Date: Sat, 30 Nov 2013 12:26:05 +0100 Subject: [PATCH] Fixed progressbar regression when going idle --- public/assets/js/picoreflow.js | 11 ++++++++++- public/index.html | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index d80349e..4652b0a 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -281,16 +281,23 @@ $(document).ready(function() { selected_profile_name = x.profile.name; } - + $.each(x.log, function(i,v) { graph.live.data.push([v.runtime, v.temperature]); graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ] , getOptions()); }); } + if(state!="EDIT") { state = x.state; + if (state!=state_last) + { + if(state_last == "RUNNING") + updateProgress(0); + } + if(state=="RUNNING") { $("#nav_start").hide(); @@ -321,6 +328,8 @@ $(document).ready(function() $('#air').css("background-color", (x.air > 0.5 ? "rgba(240, 199, 67, 0.84)" : "rgba(46, 38, 12, 0.62)") ); $('#cool').css("background-color", (x.cool > 0.5 ? "rgba(74, 159, 255, 0.84)" : "rgba(12, 28, 46, 0.62)") ); + state_last = state; + } }; diff --git a/public/index.html b/public/index.html index a4153b3..6c25a15 100644 --- a/public/index.html +++ b/public/index.html @@ -27,9 +27,9 @@
- 25 °C - OFF - Idle + 25 °C + OFF + Idle n t ,