Update select2bs5.php para que sea compatible con Vuexy Theme

This commit is contained in:
Ignacio Martinez Navajas
2023-05-29 08:26:26 +00:00
parent 3064646922
commit f15c131b11

View File

@ -1,19 +1,27 @@
<!-- Push section css -->
<?= $this->section('css') ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/css/select2.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.1.1/dist/select2-bootstrap-5-theme.min.css" />
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/select2/select2.css') ?>"/>
<?= $this->endSection() ?>
<!-- Push additional js -->
<?= $this->section('additionalExternalJs') ?>
<script src="https://cdn.jsdelivr.net/npm/select2@4.0.13/dist/js/select2.full.min.js"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/select2/select2.js') ?>"></script>
<?= $this->endSection() ?>
<?= $this->section('additionalInlineJs') ?>
$('.select2bs').select2({
theme: "bootstrap-5",
allowClear: false,
const select2 = $('.select2');
// Select2
// --------------------------------------------------------------------
if (select2.length) {
select2.each(function () {
var $this = $(this);
$this.wrap('<div class="position-relative"></div>').select2({
placeholder: 'Select value',
dropdownParent: $this.parent()
});
});
}
<?= $this->endSection() ?>
<?= $this->endSection() ?>