select with images

main
alexanderroese 2024-07-18 17:47:02 +02:00
parent a71fd0bb0a
commit 7a754dabae
1 changed files with 10 additions and 1 deletions

View File

@ -639,6 +639,15 @@
}, 10)
};
// Close the dropdown if the user clicks outside of it
window.addEventListener('click', function(event) {
if (!event.target.matches('#shx-custom-enhanced-dropdown-font-select-button')) {
if (dropdownContent.style.display === 'block') {
dropdownContent.style.display = 'none';
}
}
});
function SHX_IFC_genDropdownSelect(inputID, labelText, inputName, inputVal, options, section_id) {
let isInputShxFont = inputID === "shx-font"
@ -653,7 +662,7 @@
if (isInputShxFont) {
customDropdownHtml += `
<div class="shx-custom-enhanced-dropdown field">
<button class="shx-custom-enhanced-dropdown-button" onclick="toggleCustomEnhancedDropdownFont()">
<button class="shx-custom-enhanced-dropdown-button" onclick="toggleCustomEnhancedDropdownFont()" id="shx-custom-enhanced-dropdown-font-select-button">
<div style="display: flex; justify-content: space-between; align-items: center; pointer-events: none; height: 40px">
<div style="position: relative; top: 4px; width: 120px">
<img id="shx-custom-enhanced-dropdown-font-select-selected-value" alt="lade..." style="height: 28px"></img>