Commit 6f917d73 authored by Priit Laes's avatar Priit Laes

Add workaround for width calculation of with empty Select2 fields

See https://github.com/ivaynberg/select2/issues/426
parent bf166071
......@@ -3,10 +3,10 @@
this.applyStyle = function(el, name) {
switch (name) {
case 'select2':
$(el).select2();
$(el).select2({width: 'resolve'});
break;
case 'select2blank':
$(el).select2({allowClear: true});
$(el).select2({allowClear: true, width: 'resolve'});
break;
case 'datepicker':
$(el).datepicker();
......@@ -49,8 +49,8 @@
};
this.applyGlobalStyles = function(parent) {
$('[data-role=select2]', parent).select2();
$('[data-role=select2blank]', parent).select2({allowClear: true});
$('[data-role=select2]', parent).select2({width: 'resolve'});
$('[data-role=select2blank]', parent).select2({allowClear: true, width: 'resolve'});
$('[data-role=datepicker]', parent).datepicker();
$('[data-role=datetimepicker]', parent).datepicker({displayTime: true});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment