19 lines
735 B
PHP
19 lines
735 B
PHP
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/js/tom-select.complete.min.js"></script>
|
|
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/css/tom-select.bootstrap5.min.css" rel="stylesheet">
|
|
<script>
|
|
window.addEventListener('load', () => {
|
|
document.querySelectorAll('select').forEach((el) => {
|
|
if (!el.classList.contains('ts-hidden-accessible')) {
|
|
console.log('Initializing TomSelect on:', el);
|
|
new TomSelect(el, {
|
|
create: false,
|
|
sortField: {
|
|
field: "text",
|
|
direction: "asc"
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|