feat: centralize tomselect logic and script loading

This commit is contained in:
2026-05-01 14:22:47 -04:00
parent 7bf32dfdcc
commit 239ee20397
37 changed files with 41 additions and 9 deletions
@@ -1,19 +1,14 @@
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/js/tom-select.complete.min.js"></script>
@push('js')
<link href="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/css/tom-select.bootstrap5.min.css" rel="stylesheet">
<style>
.ts-wrapper .ts-control, .ts-wrapper .ts-control input {
background-color: #ffffff !important;
border: 1px solid #ced4da !important;
}
.ts-dropdown {
background-color: #ffffff !important;
}
.ts-wrapper .ts-control, .ts-wrapper .ts-control input { background-color: #ffffff !important; border: 1px solid #ced4da !important; }
.ts-dropdown { background-color: #ffffff !important; }
</style>
<script src="https://cdn.jsdelivr.net/npm/tom-select@2.4.3/dist/js/tom-select.complete.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll('select').forEach((el) => {
if (el.tomselect) return;
new TomSelect(el, {
copyClassesToDropdown: false,
dropdownParent: 'body',
@@ -31,3 +26,4 @@
});
});
</script>
@endpush