Merge pull request #263 from SchrodingersGat/select2-fix

Modal fixes
This commit is contained in:
Oliver 2019-05-08 23:03:38 +10:00 committed by GitHub
commit a7794394a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -10,6 +10,11 @@
color: #ffcc00;
}
/* Force select2 elements in modal forms to be full width */
.select-full-width {
width: 100%;
}
/* Part image icons with full-display on mouse hover */
.hover-img-thumb {
@ -118,6 +123,10 @@
z-index: 99999999;
}
.modal-dialog {
width: 45%;
}
.modal-content h3 {
margin-top: 3px;
margin-bottom: 3px;

View File

@ -13,8 +13,11 @@ function attachSelect(modal) {
$(modal + ' .select').select2({
dropdownParent: $(modal),
// dropdownAutoWidth parameter is required to work properly with modal forms
dropdownAutoWidth: true,
dropdownAutoWidth: false,
});
$(modal + ' .select2-container').addClass('select-full-width');
$(modal + ' .select2-container').css('width', '100%');
}