Aded documentation module
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
@script
|
||||
<script>
|
||||
const initialiseHelpdeskSelect2 = function () {
|
||||
if (!window.jQuery || !window.jQuery.fn || !window.jQuery.fn.select2) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.jQuery('[data-helpdesk-select2], [data-helpdesk-select]').each(function () {
|
||||
const element = window.jQuery(this);
|
||||
|
||||
if (element.data('select2')) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.select2({
|
||||
width: '100%',
|
||||
theme: 'default'
|
||||
});
|
||||
|
||||
element.on('change', function () {
|
||||
this.dispatchEvent(new Event('input', { bubbles: true }));
|
||||
this.dispatchEvent(new Event('change', { bubbles: true }));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
initialiseHelpdeskSelect2();
|
||||
document.addEventListener('livewire:navigated', initialiseHelpdeskSelect2);
|
||||
</script>
|
||||
@endscript
|
||||
Reference in New Issue
Block a user