From f15c131b110b9c1d5d83b36277057abad1def2ae Mon Sep 17 00:00:00 2001 From: Ignacio Martinez Navajas Date: Mon, 29 May 2023 08:26:26 +0000 Subject: [PATCH] Update select2bs5.php para que sea compatible con Vuexy Theme --- .../themes/_commonPartialsBs/select2bs5.php | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/ci4/app/Views/themes/_commonPartialsBs/select2bs5.php b/ci4/app/Views/themes/_commonPartialsBs/select2bs5.php index c5afb660..fa722685 100644 --- a/ci4/app/Views/themes/_commonPartialsBs/select2bs5.php +++ b/ci4/app/Views/themes/_commonPartialsBs/select2bs5.php @@ -1,19 +1,27 @@ section('css') ?> - - + endSection() ?> section('additionalExternalJs') ?> - + endSection() ?> section('additionalInlineJs') ?> - - $('.select2bs').select2({ - theme: "bootstrap-5", - allowClear: false, + + const select2 = $('.select2'); + + // Select2 + // -------------------------------------------------------------------- + if (select2.length) { + select2.each(function () { + var $this = $(this); + $this.wrap('
').select2({ + placeholder: 'Select value', + dropdownParent: $this.parent() + }); }); + } -endSection() ?> \ No newline at end of file +endSection() ?>