From 726fc3e955e9852939f128ef72441a4bd01b5772 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Tue, 30 Aug 2016 19:50:05 +0200 Subject: [PATCH] fixed event icons and added 10s refresh to map --- resource/web/map.tmpl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resource/web/map.tmpl b/resource/web/map.tmpl index 4bd7168a..e60fefe3 100755 --- a/resource/web/map.tmpl +++ b/resource/web/map.tmpl @@ -58,7 +58,7 @@ } svg = SVG("map"); - drawMap(); + drawLoop(); // set events $("#button-edit").click(function() { @@ -128,6 +128,12 @@ } } + function drawLoop(){ + if (editModeEnabled == false) + drawMap(); + setTimeout("drawMap()", 10000); + } + function drawMap(){ // Get map data $.getJSON("?json&action=getdata", function(json){ @@ -151,7 +157,7 @@ $.each(json.events, function(i, event) { var group = svg.group(); var img = "/img/lightbulb_off.svg"; - if (event.data > 0) + if (event.data == "ON") var img = "/img/lightbulb_on.svg"; group.image(img) .addClass("draggable").addClass("event")