Private GIT

Skip to content
Snippets Groups Projects
Commit fe234b56 authored by Ridene's avatar Ridene
Browse files

#MON-1465 : improve select2 UX

parent e31cc8ec
No related branches found
No related tags found
No related merge requests found
...@@ -207,13 +207,16 @@ p.description a, p.description a:visited { ...@@ -207,13 +207,16 @@ p.description a, p.description a:visited {
width: 213px !important; width: 213px !important;
} }
.select2-selection {
cursor: initial !important;
}
.select2-container .select2-selection--multiple { .select2-container .select2-selection--multiple {
min-height: auto !important; min-height: auto !important;
} }
.select2-container .select2-search--inline .select2-search__field { .select2-container .select2-search--inline .select2-search__field {
margin-top: 0 !important; margin-top: 0 !important;
width: 200px !important;
} }
.select2-container--default .select2-selection--single { .select2-container--default .select2-selection--single {
...@@ -267,10 +270,17 @@ p.description a, p.description a:visited { ...@@ -267,10 +270,17 @@ p.description a, p.description a:visited {
background-color: #bfecff !important; background-color: #bfecff !important;
} }
.select2-container--default .select2-selection--multiple .select2-selection__rendered { .formTable .select2-container--default .select2-selection--multiple .select2-selection__rendered {
min-height: 28px;
}
.ajaxOption .select2-container--default .select2-selection--multiple .select2-selection__rendered {
max-height: 80px; max-height: 80px;
} }
.formTable .select2-container--default .select2-selection--multiple .select2-selection__rendered {
min-height: 28px;
}
/* Selected elements */ /* Selected elements */
.select2-results-header { .select2-results-header {
......
...@@ -84,6 +84,18 @@ ...@@ -84,6 +84,18 @@
if (this.settings.multiple) { if (this.settings.multiple) {
this.initMultiple(); this.initMultiple();
} }
this.resizeSelect2();
},
resizeSelect2: function() {
var formSpan = jQuery(".formTable span.select2-container");
formSpan.css({
'min-width': '360px',
});
formSpan.find('.select2-selection--multiple .select2-selection__rendered').css({
'resize': 'vertical'
});
}, },
/** /**
* Load the locale, if not defined in settings use the browser locale * Load the locale, if not defined in settings use the browser locale
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
*/ */
jQuery(function() { jQuery(function() {
// minimum width of the selectbox, change it if you want // minimum width of the selectbox, change it if you want
var minAllowedWidth = 270; var minAllowedWidth = 360;
// maximum width of the selectbox, twice larger than minimum width // maximum width of the selectbox, twice larger than minimum width
var maxAllowedWidth = (minAllowedWidth * 2); var maxAllowedWidth = (minAllowedWidth * 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment