forked from TFMM/silent-auction
27 lines
905 B
PHP
27 lines
905 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">
|
|
<style>
|
|
/* Ensure the TomSelect container doesn't get a transparent background */
|
|
.ts-control {
|
|
background-color: white !important;
|
|
border: 1px solid #ddd !important;
|
|
}
|
|
</style>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
document.querySelectorAll('select').forEach((el) => {
|
|
if (el.tomselect) return;
|
|
|
|
new TomSelect(el, {
|
|
create: false,
|
|
hideSelected: true,
|
|
maxOptions: null,
|
|
sortField: {
|
|
field: 'text',
|
|
direction: 'asc'
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|