forked from TFMM/silent-auction
feat: install and scaffold Tablar theme #6
@@ -1,32 +1,19 @@
|
||||
<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>
|
||||
.ts-control { background-color: #ffffff !important; border: 1px solid #ced4da !important; min-height: 38px !important; }
|
||||
</style>
|
||||
<script>
|
||||
(function() {
|
||||
const init = () => {
|
||||
console.log('TomSelect Initializing...');
|
||||
const selects = document.querySelectorAll('select');
|
||||
console.log('Select count:', selects.length);
|
||||
selects.forEach((el) => {
|
||||
if (el.tomselect) return;
|
||||
try {
|
||||
new TomSelect(el, {
|
||||
create: false,
|
||||
sortField: { field: 'text', direction: 'asc' }
|
||||
});
|
||||
console.log('Initialized TomSelect on', el);
|
||||
} catch(e) {
|
||||
console.error('TomSelect init error', e);
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
document.querySelectorAll('select').forEach((el) => {
|
||||
if (el.tomselect) return;
|
||||
|
||||
new TomSelect(el, {
|
||||
copyClassesToDropdown: false,
|
||||
dropdownParent: 'body',
|
||||
controlInput: '<input>',
|
||||
sortField: {
|
||||
field: 'text',
|
||||
direction: 'asc'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init);
|
||||
} else {
|
||||
init();
|
||||
}
|
||||
})();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user