From a71115812e886c16dde9c2895424c996c1195696 Mon Sep 17 00:00:00 2001 From: Michael Scherle Date: Thu, 19 Jan 2017 13:09:40 +0100 Subject: frontend: fixed missing defect pc images, fixe the pc's without coords got an , fixed: -Die img Tags bekommen die PC-UUID als element-id, wenn die mit ner Zahl anfängt dürfte das keine valide id sein.- --- .../locationinfo/frontend/doorsign.html | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'modules-available') diff --git a/modules-available/locationinfo/frontend/doorsign.html b/modules-available/locationinfo/frontend/doorsign.html index 2b2ce50f..28c1e2db 100755 --- a/modules-available/locationinfo/frontend/doorsign.html +++ b/modules-available/locationinfo/frontend/doorsign.html @@ -1092,13 +1092,14 @@ optional: function setUpRoom() { for (var i = 0; i < Layout.length; i++) { - - var img = $('', - { - id: Layout[i].id, - class: "pcImg" - }) - .appendTo($('#roomLayout')); + if (Layout[i].y != null && Layout[i].x != null) { + var img = $('', + { + id: "layout_PC" + Layout[i].id, + class: "pcImg" + }) + .appendTo($('#roomLayout')); + } } scaleRoom(); UpdatePc(Layout); @@ -1142,10 +1143,10 @@ optional: } for (var i = 0; i < Layout.length; i++) { if (Layout[i].y != null && Layout[i].x != null) { - document.getElementById(Layout[i].id).width = (picSizeX * scale); - document.getElementById(Layout[i].id).height = (picSizeY * scale); - document.getElementById(Layout[i].id).style.left = ((parseInt(Layout[i].x) + xOffset) * scale) + "px"; - document.getElementById(Layout[i].id).style.top = ((parseInt(Layout[i].y) + yOffset) * scale ) + "px"; + document.getElementById("layout_PC" + Layout[i].id).width = (picSizeX * scale); + document.getElementById("layout_PC" + Layout[i].id).height = (picSizeY * scale); + document.getElementById("layout_PC" + Layout[i].id).style.left = ((parseInt(Layout[i].x) + xOffset) * scale) + "px"; + document.getElementById("layout_PC" + Layout[i].id).style.top = ((parseInt(Layout[i].y) + yOffset) * scale ) + "px"; } } } @@ -1154,7 +1155,7 @@ optional: function UpdatePc(update) { var freePcs = 0; for (var i = 0; i < update.length; i++) { - var imgobj = document.getElementById(update[i].id); + var imgobj = document.getElementById("layout_PC" + update[i].id); var img; if (update[i].pcState == "0") { @@ -1173,7 +1174,7 @@ optional: } } else { if (supportSvg) { - img = "img/pc_defect?"; + img = "img/pc_defect"; } else { imgobj.style.backgroundColor = "black"; } -- cgit v1.2.3-55-g7522