Files
silent-auction/resources/views/components/tomselect.blade.php
T

17 lines
802 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', function() {
console.log("TOMSELECT DEBUG: Page loaded, checking for selects...");
var selects = document.querySelectorAll('select');
console.log("TOMSELECT DEBUG: Found " + selects.length + " selects.");
selects.forEach(function(el) {
console.log("TOMSELECT DEBUG: Initializing", el.id, "Options:", el.options.length);
new TomSelect(el, {
create: false,
sortField: { field: 'text', direction: 'asc' }
});
});
});
</script>