diff --git a/www/cgi/get_pattern_element_list.cgi b/www/cgi/get_pattern_element_list.cgi index c86e0fa7..74424446 100755 --- a/www/cgi/get_pattern_element_list.cgi +++ b/www/cgi/get_pattern_element_list.cgi @@ -25,7 +25,7 @@ def main(): # Handle unweighted genecarts which are not saved to tabfile. # NOTE: Does not check db for existence of unweighted genecart if scope == "unweighted-list": - result.append({"label":"unweighted", "top_up":[], "top_down":[], "binary": True}) + result.append({"label":"unweighted", "top_up":"", "top_down":"", "binary": True}) print(json.dumps(result)) return diff --git a/www/js/projection.js b/www/js/projection.js index cac20b60..b54d04a9 100644 --- a/www/js/projection.js +++ b/www/js/projection.js @@ -366,13 +366,17 @@ const selectPatternWeightResult = async (label) => { // if projection algorithm is "nmf", then hide the top_down genes const projectionAlgorithm = document.getElementById('algorithm').value; + + const topDownGenesElement = document.getElementById('top-down-genes'); + + // Hide the element initially + topDownGenesElement.classList.add('is-hidden'); + if (projectionAlgorithm === 'nmf') { - //document.getElementById('svg-scoring-method').value = 'top_up'; ? Why is this here? Not a valid value - document.getElementById('top-down-genes').classList.add('is-hidden'); - } else { - if (obj.top_down) { - document.getElementById('top-down-genes').classList.remove('is-hidden'); - } + // No additional action needed as the element is already hidden + } else if (obj.top_down) { + // Show the element if 'top_down' property is true + topDownGenesElement.classList.remove('is-hidden'); } // if isMulti=false, show top_up and top_down genes