added "No Options" text on select dropdowns
Some checks failed
Build and Push Docker Image / build (push) Failing after 6m56s

This commit is contained in:
Corban-Lee Jones 2024-10-28 22:03:26 +00:00
parent cefa56f095
commit c7b62719a3

View File

@ -264,6 +264,13 @@ $(document).ready(function() {
$dropdown.append($option)
});
// For no options, display a message
if (!$select.find("option").length) {
const $noOptions = $('<div class="corbz-select-text">');
$noOptions.text("No options available");
$dropdown.append($noOptions);
}
// Initialize display, and detect future changes
updateSelectedDisplayWrapper();
$select.on("change", updateSelectedDisplayWrapper);