summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-15 12:35:54 +0100
committerSimon Rettberg2017-12-15 12:35:54 +0100
commit853f0abb399ce33ecfc292219b3fc72c00df72ef (patch)
tree67187c45c64c4d78408ef3c364032bf3c287917b /modules-available/roomplanner
parent[sysconfig] Update translations (diff)
downloadslx-admin-853f0abb399ce33ecfc292219b3fc72c00df72ef.tar.gz
slx-admin-853f0abb399ce33ecfc292219b3fc72c00df72ef.tar.xz
slx-admin-853f0abb399ce33ecfc292219b3fc72c00df72ef.zip
[roomplanner] Fix deleting PCs after loading room plan
Diffstat (limited to 'modules-available/roomplanner')
-rw-r--r--modules-available/roomplanner/clientscript.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules-available/roomplanner/clientscript.js b/modules-available/roomplanner/clientscript.js
index 722e3909..5c9776b2 100644
--- a/modules-available/roomplanner/clientscript.js
+++ b/modules-available/roomplanner/clientscript.js
@@ -174,9 +174,14 @@ function onBtnSelect() {
}
function onPcDelete(muuid) {
- var bySubnet = machineCache[muuid];
- var bySearch = machineCache[muuid];
- var value = !bySubnet ? bySearch : bySubnet;
+ var value = machineCache[muuid];
+ if (!value) {
+ subnetMachines.forEach(function (v, i, a) {
+ if (subnetMachines[i] && subnetMachines[i].machineuuid === muuid) {
+ value = subnetMachines[i];
+ }
+ });
+ }
value.fixedlocationid = null;
makeCombinedFieldSingle(value);
}