summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/frontend/doorsign.html
diff options
context:
space:
mode:
authorMichael Scherle2017-01-20 14:10:52 +0100
committerMichael Scherle2017-01-20 14:10:52 +0100
commit05b1fc7e7e2705033cf8b9c83bcc51d2a38a3b24 (patch)
tree027cb2db122a9102a1b2d866badf006cfcaea27f /modules-available/locationinfo/frontend/doorsign.html
parentfrontend: fixed not showing free pc ount sometimes (diff)
downloadslx-admin-05b1fc7e7e2705033cf8b9c83bcc51d2a38a3b24.tar.gz
slx-admin-05b1fc7e7e2705033cf8b9c83bcc51d2a38a3b24.tar.xz
slx-admin-05b1fc7e7e2705033cf8b9c83bcc51d2a38a3b24.zip
frontend: hide pcs with pos == null
Diffstat (limited to 'modules-available/locationinfo/frontend/doorsign.html')
-rwxr-xr-xmodules-available/locationinfo/frontend/doorsign.html69
1 files changed, 37 insertions, 32 deletions
diff --git a/modules-available/locationinfo/frontend/doorsign.html b/modules-available/locationinfo/frontend/doorsign.html
index a24462aa..d95ccbb6 100755
--- a/modules-available/locationinfo/frontend/doorsign.html
+++ b/modules-available/locationinfo/frontend/doorsign.html
@@ -1024,7 +1024,7 @@ optional:
}
for (var i = 0; i < Layout.length; i++) {
- if (!isNaN(parseInt(Layout[i].x)) && !isNaN(parseInt(Layout[i].y))) {
+ if (!isNaN(parseInt(Layout[i].x)) && !isNaN(parseInt(Layout[i].y)) && Layout[i].y != null && Layout[i].y != null) {
if (minX === undefined) {
minX = parseInt(Layout[i].x);
}
@@ -1096,7 +1096,7 @@ optional:
function setUpRoom() {
for (var i = 0; i < Layout.length; i++) {
- if (Layout[i].y != null && Layout[i].x != null) {
+ if (Layout[i].y != null && Layout[i].x != null && !isNaN(Layout[i].y)&& !isNaN(Layout[i].x)) {
var img = $('<img />',
{
id: "layout_PC" + Layout[i].id,
@@ -1146,11 +1146,14 @@ optional:
return;
}
for (var i = 0; i < Layout.length; i++) {
- if (Layout[i].y != null && Layout[i].x != null) {
- 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";
+ if (Layout[i].y != null && Layout[i].x != null && !isNaN(Layout[i].y)&& !isNaN(Layout[i].x)) {
+ var tmp = document.getElementById("layout_PC" + Layout[i].id);
+ if(tmp != null) {
+ tmp.width = (picSizeX * scale);
+ tmp.height = (picSizeY * scale);
+ tmp.style.left = ((parseInt(Layout[i].x) + xOffset) * scale) + "px";
+ tmp.style.top = ((parseInt(Layout[i].y) + yOffset) * scale ) + "px";
+ }
}
}
}
@@ -1160,34 +1163,36 @@ optional:
var freePcs = 0;
for (var i = 0; i < update.length; i++) {
var imgobj = document.getElementById("layout_PC" + update[i].id);
-
- var img;
- if (update[i].pcState == "0") {
- //add time to prevent caching
- if (supportSvg) {
- img = "img/pc_free";
- } else {
- imgobj.style.backgroundColor = "green";
- }
- freePcs++;
- } else if (update[i].pcState == "1") {
- if (supportSvg) {
- img = "img/pc_used";
- } else {
- imgobj.style.backgroundColor = "red";
- }
- } else {
- if (supportSvg) {
- img = "img/pc_defect";
+ if (imgobj != null) {
+
+ var img;
+ if (update[i].pcState == "0") {
+ //add time to prevent caching
+ if (supportSvg) {
+ img = "img/pc_free";
+ } else {
+ imgobj.style.backgroundColor = "green";
+ }
+ freePcs++;
+ } else if (update[i].pcState == "1") {
+ if (supportSvg) {
+ img = "img/pc_used";
+ } else {
+ imgobj.style.backgroundColor = "red";
+ }
} else {
- imgobj.style.backgroundColor = "black";
+ if (supportSvg) {
+ img = "img/pc_defect";
+ } else {
+ imgobj.style.backgroundColor = "black";
+ }
}
- }
- if (imgobj != null && supportSvg) {
- if (eInkMode) {
- img = img + "_eink";
+ if (imgobj != null && supportSvg) {
+ if (eInkMode) {
+ img = img + "_eink";
+ }
+ imgobj.src = img + ".svg";
}
- imgobj.src = img + ".svg";
}
}
if (state == null || state.state == "FreeNoEnd" || state.state == "Free") {