1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-04 15:00:14 +01:00

mild cleanup

This commit is contained in:
Anthony Stirling 2023-12-27 12:51:17 +00:00
parent 61ff0248da
commit f5c285a70f
2 changed files with 17 additions and 2 deletions

View File

@ -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';
}
}

View File

@ -157,7 +157,7 @@
<button id="addOperationBtn" class="btn btn-primary">Add
operation</button>
</div>
<h3>Pipeline:</h3>
<h3 id="pipelineHeader" style="display: none;">Pipeline:</h3>
<ol id="pipelineList" class="list-group">
<!-- Pipeline operations will be dynamically populated here -->
</ol>