From 8ea536da45c61ce1ef0af3e96790cb31f7f3647d Mon Sep 17 00:00:00 2001 From: Daniel Sevilla Date: Tue, 17 Dec 2019 11:28:05 +0100 Subject: [PATCH] Fix JS issue in STED pages. --- scripts/common.js | 6 ++++-- sted_parameters.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/common.js b/scripts/common.js index b847559c0..f6cbeb0bb 100644 --- a/scripts/common.js +++ b/scripts/common.js @@ -387,6 +387,8 @@ function changeStedEntryProperties(selectObj, channel) { var tag = tagArray[i]; var id = tag.concat(channel); + if (document.getElementById(id) == null) continue; + var inputElement = document.getElementById(id); if ( selectObj.value == 'off-confocal' ) { @@ -400,10 +402,10 @@ function changeStedEntryProperties(selectObj, channel) { } -function setStedEntryProperties( ) { +function setStedEntryProperties(chanCnt) { var tag = "StedDepletionMode"; - for (var chan = 0; chan < 6; chan++) { + for (var chan = 0; chan < chanCnt; chan++) { var name = tag.concat(chan); var inputElement = document.getElementsByName(name); diff --git a/sted_parameters.php b/sted_parameters.php index 51517657b..435079705 100644 --- a/sted_parameters.php +++ b/sted_parameters.php @@ -725,7 +725,7 @@ class="multichannelinput"/>