select with images
parent
75d3ee008d
commit
a61b4e2716
|
@ -663,17 +663,21 @@
|
|||
html += `<option value="${optionValue}" ${inputVal === optionValue ? 'selected' : ''}>${optionDisplayName}</option>`;
|
||||
|
||||
if (isInputShxFont) {
|
||||
const fontAssetName = `shx-texte-font-${optionValue.toLowerCase().split(" ").join("-")}.svg`
|
||||
// const fontAssetName = `shx-texte-font-${optionValue.toLowerCase().split(" ").join("-")}.svg`
|
||||
|
||||
const imgSrc = "{{ `${fontAssetName}` | asset_url }}"
|
||||
// const imgSrc = `{{ '' | asset_url }}${fontAssetName}`;
|
||||
|
||||
console.log("fontAssetName", fontAssetName, imgSrc)
|
||||
console.log("here fontAssetName")
|
||||
|
||||
{% assign option_value = optionValue %}
|
||||
{% assign font_asset_name = "shx-texte-font-" | append: option_value | downcase | replace: " ", "-" | append: ".svg" %}
|
||||
{% assign img_src = font_asset_name | asset_url %}
|
||||
|
||||
customDropdownHtml += `
|
||||
<div data-value="${optionValue}" class="${inputVal === optionValue ? 'shx-custom-enhanced-dropdown-variant-selected' : ''}" onclick="onFontDropdownItemClick(event)">
|
||||
<span>${optionDisplayName}</span>
|
||||
|
||||
<img src="${imgSrc}" alt="${optionDisplayName}"/>
|
||||
<img src="{{ img_src }}" alt="${optionDisplayName}"/>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue