summaryrefslogtreecommitdiffstats
path: root/htdocs/webiopi.js
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs/webiopi.js')
-rw-r--r--htdocs/webiopi.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/htdocs/webiopi.js b/htdocs/webiopi.js
index f893618..568bbb0 100644
--- a/htdocs/webiopi.js
+++ b/htdocs/webiopi.js
@@ -211,9 +211,12 @@ WebIOPi.prototype.addALT = function (alt, gpio, name) {
211} 211}
212 212
213WebIOPi.prototype.updateValue = function (gpio, value) { 213WebIOPi.prototype.updateValue = function (gpio, value) {
214 old_value = w().GPIO[gpio].value
214 w().GPIO[gpio].value = value; 215 w().GPIO[gpio].value = value;
215 var style = (value == 1) ? "HIGH" : "LOW"; 216 var style = (value == 1) ? "HIGH" : "LOW";
216 $("#gpio"+gpio).attr("class", style); 217 $("#gpio"+gpio).attr("class", style);
218 if (old_value != value)
219 $("#gpio"+gpio).trigger("updateValue", [ gpio, old_value, value ])
217} 220}
218 221
219WebIOPi.prototype.updateFunction = function (gpio, func) { 222WebIOPi.prototype.updateFunction = function (gpio, func) {