From f5c285a70f2efbe9cf08161f155436f6c5c63345 Mon Sep 17 00:00:00 2001 From: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> Date: Wed, 27 Dec 2023 12:51:17 +0000 Subject: [PATCH] mild cleanup --- src/main/resources/static/js/pipeline.js | 17 ++++++++++++++++- src/main/resources/templates/pipeline.html | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/resources/static/js/pipeline.js b/src/main/resources/static/js/pipeline.js index 21c05cb8..496aa942 100644 --- a/src/main/resources/static/js/pipeline.js +++ b/src/main/resources/static/js/pipeline.js @@ -274,11 +274,13 @@ document.getElementById('addOperationBtn').addEventListener('click', function() listItem.querySelector('.remove').addEventListener('click', function(event) { event.preventDefault(); pipelineList.removeChild(listItem); + hideOrShowPipelineHeader(); }); listItem.querySelector('.pipelineSettings').addEventListener('click', function(event) { event.preventDefault(); showpipelineSettingsModal(selectedOperation); + hideOrShowPipelineHeader(); }); function showpipelineSettingsModal(operation) { @@ -452,7 +454,7 @@ document.getElementById('addOperationBtn').addEventListener('click', function() // } //} } - + hideOrShowPipelineHeader(); }); @@ -572,6 +574,7 @@ document.getElementById('addOperationBtn').addEventListener('click', function() processPipelineConfig(event.target.result); }; reader.readAsText(e.target.files[0]); + hideOrShowPipelineHeader(); }); document.getElementById('pipelineSelect').addEventListener('change', function(e) { @@ -580,3 +583,15 @@ document.getElementById('addOperationBtn').addEventListener('click', function() }); + function hideOrShowPipelineHeader() { + var pipelineHeader = document.getElementById('pipelineHeader'); + var pipelineList = document.getElementById('pipelineList'); + + if (pipelineList.children.length === 0) { + // Hide the pipeline header if there are no items in the pipeline list + pipelineHeader.style.display = 'none'; + } else { + // Show the pipeline header if there are items in the pipeline list + pipelineHeader.style.display = 'block'; + } + } diff --git a/src/main/resources/templates/pipeline.html b/src/main/resources/templates/pipeline.html index 8952251d..6e121efb 100644 --- a/src/main/resources/templates/pipeline.html +++ b/src/main/resources/templates/pipeline.html @@ -157,7 +157,7 @@ -

Pipeline:

+