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 @@ ...@@ -3,10 +3,10 @@
this.applyStyle = function(el, name) { this.applyStyle = function(el, name) {
switch (name) { switch (name) {
case 'select2': case 'select2':
$(el).select2(); $(el).select2({width: 'resolve'});
break; break;
case 'select2blank': case 'select2blank':
$(el).select2({allowClear: true}); $(el).select2({allowClear: true, width: 'resolve'});
break; break;
case 'datepicker': case 'datepicker':
$(el).datepicker(); $(el).datepicker();
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
}; };
this.applyGlobalStyles = function(parent) { this.applyGlobalStyles = function(parent) {
$('[data-role=select2]', parent).select2(); $('[data-role=select2]', parent).select2({width: 'resolve'});
$('[data-role=select2blank]', parent).select2({allowClear: true}); $('[data-role=select2blank]', parent).select2({allowClear: true, width: 'resolve'});
$('[data-role=datepicker]', parent).datepicker(); $('[data-role=datepicker]', parent).datepicker();
$('[data-role=datetimepicker]', parent).datepicker({displayTime: true}); $('[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