fas
This commit is contained in:
parent
83dc807640
commit
c525e97fcb
|
|
@ -1270,4 +1270,22 @@ select.selectpicker {
|
|||
border: 1px solid #ced4da !important;
|
||||
background-color: #fff !important;
|
||||
font-size: 0.8rem !important;
|
||||
}
|
||||
|
||||
/* Limite la largeur du menu déroulant quand il est attaché au body */
|
||||
body > .bootstrap-select.dropdown {
|
||||
max-width: 400px !important; /* Ajustez selon vos besoins */
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
/* Assure que la boîte de recherche reste compacte */
|
||||
.bootstrap-select .dropdown-menu {
|
||||
min-width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
/* Fix pour l'affichage plein écran */
|
||||
.bootstrap-select.show {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
|
@ -91555,29 +91555,24 @@ function initSelectPicker() {
|
|||
* Gère la langue, évite les doublons et active la recherche
|
||||
*/
|
||||
function ui_refresh_select(selector) {
|
||||
let $el = $(selector);
|
||||
var $el = $(selector);
|
||||
if ($el.length === 0) return;
|
||||
|
||||
// Récupération de la langue (via un input hidden ou une variable globale)
|
||||
let codeLangue = $("#codeLangue").val();
|
||||
let placeholder = (codeLangue === "en_US") ? 'Search...' : 'Rechercher...';
|
||||
let noneText = (codeLangue === "en_US") ? 'Nothing selected' : 'Rien de sélectionné';
|
||||
|
||||
if (typeof $.fn.selectpicker !== 'undefined') {
|
||||
// Nettoyage et réinitialisation
|
||||
$el.selectpicker('destroy').selectpicker({
|
||||
style: 'btn-form-select',
|
||||
liveSearch: true,
|
||||
liveSearchPlaceholder: placeholder,
|
||||
noneSelectedText: noneText,
|
||||
width: '100%',
|
||||
container: 'body' // Recommandé pour éviter les problèmes de scroll
|
||||
});
|
||||
} else if (typeof $.fn.select2 !== 'undefined') {
|
||||
// Fallback Select2
|
||||
$el.select2({
|
||||
theme: 'bootstrap-5',
|
||||
width: '100%'
|
||||
width: '100%', // Assure que le bouton prend la largeur de la colonne
|
||||
container: 'body',
|
||||
dropdownAlignRight: 'auto',
|
||||
// On force la taille du menu déroulant
|
||||
size: 'auto'
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user