mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-20 14:36:34 +02:00
Don't use template literals on demo
This commit is contained in:
parent
750f98e54c
commit
9bb84df8d0
54
index.html
54
index.html
|
@ -283,10 +283,10 @@
|
||||||
editItems: true,
|
editItems: true,
|
||||||
maxItemCount: 5,
|
maxItemCount: 5,
|
||||||
addItemText: function(value) {
|
addItemText: function(value) {
|
||||||
return `Appuyez sur Entrée pour ajouter <b>"${value}"</b>`;
|
return 'Appuyez sur Entrée pour ajouter <b>"' + String(value) + '"</b>';
|
||||||
},
|
},
|
||||||
maxItemText: function(maxItemCount) {
|
maxItemText: function(maxItemCount) {
|
||||||
return `${maxItemCount} valeurs peuvent être ajoutées`;
|
return String(maxItemCount) + 'valeurs peuvent être ajoutées';
|
||||||
},
|
},
|
||||||
uniqueItemText: 'Cette valeur est déjà présente',
|
uniqueItemText: 'Cette valeur est déjà présente',
|
||||||
});
|
});
|
||||||
|
@ -462,33 +462,33 @@
|
||||||
var itemSelectText = this.config.itemSelectText;
|
var itemSelectText = this.config.itemSelectText;
|
||||||
return {
|
return {
|
||||||
item: function(data) {
|
item: function(data) {
|
||||||
return strToEl(`
|
return strToEl('\
|
||||||
<div
|
<div\
|
||||||
class="${classNames.item} ${data.highlighted ? classNames.highlightedState : classNames.itemSelectable}"
|
class="'+ String(classNames.item) + ' ' + String(data.highlighted ? classNames.highlightedState : classNames.itemSelectable) + '"\
|
||||||
data-item
|
data-item\
|
||||||
data-id="${data.id}"
|
data-id="'+ String(data.id) + '"\
|
||||||
data-value="${data.value}"
|
data-value="'+ String(data.value) +'"\
|
||||||
${data.active ? 'aria-selected="true"' : ''}
|
'+ String(data.active ? 'aria-selected="true"' : '') + '\
|
||||||
${data.disabled ? 'aria-disabled="true"' : ''}
|
'+ String(data.disabled ? 'aria-disabled="true"' : '') + '\
|
||||||
>
|
>\
|
||||||
<span style="margin-right:10px;">🎉</span> ${data.label}
|
<span style="margin-right:10px;">🎉</span> ' + String(data.label) + '\
|
||||||
</div>
|
</div>\
|
||||||
`);
|
');
|
||||||
},
|
},
|
||||||
choice: function(data) {
|
choice: function(data) {
|
||||||
return strToEl(`
|
return strToEl('\
|
||||||
<div
|
<div\
|
||||||
class="${classNames.item} ${classNames.itemChoice} ${data.disabled ? classNames.itemDisabled : classNames.itemSelectable}"
|
class="'+ String(classNames.item) + ' ' + String(classNames.itemChoice) + ' ' + String(data.disabled ? classNames.itemDisabled : classNames.itemSelectable) + '"\
|
||||||
data-select-text="${itemSelectText}"
|
data-select-text="'+ String(itemSelectText) +'"\
|
||||||
data-choice
|
data-choice \
|
||||||
${data.disabled ? 'data-choice-disabled aria-disabled="true"' : 'data-choice-selectable'}
|
'+ String(data.disabled ? 'data-choice-disabled aria-disabled="true"' : 'data-choice-selectable') + '\
|
||||||
data-id="${data.id}"
|
data-id="'+ String(data.id) +'"\
|
||||||
data-value="${data.value}"
|
data-value="'+ String(data.value) +'"\
|
||||||
${data.groupId > 0 ? 'role="treeitem"' : 'role="option"'}
|
'+ String(data.groupId > 0 ? 'role="treeitem"' : 'role="option"') + '\
|
||||||
>
|
>\
|
||||||
<span style="margin-right:10px;">👉🏽</span> ${data.label}
|
<span style="margin-right:10px;">👉🏽</span> ' + String(data.label) + '\
|
||||||
</div>
|
</div>\
|
||||||
`);
|
');
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue