BUGFIX fix the field generated by choser with 0 width in an iFrame popup

This commit is contained in:
Normann Lou 2012-03-27 17:06:58 +02:00 committed by Ingo Schommer
parent a95b11d004
commit 7a27832297

View File

@ -18,6 +18,16 @@ jQuery.noConflict();
spinner.show();
};
// apply an select element only when it is ready, ie. when it is rendered into a template
// with css applied and got a width value.
var applyChosen = function(el){
if(el.outerWidth()){
el.chosen().addClass("has-chzn");
} else {
setTimeout(function() {applyChosen(el);},500);
}
};
$(window).bind('resize', positionLoadingSpinner).trigger('resize');
// global ajax error handlers
@ -456,8 +466,8 @@ jQuery.noConflict();
// Explicitly disable default placeholder if no custom one is defined
if(!this.data('placeholder')) this.data('placeholder', ' ');
// Apply chosen
this.chosen().addClass("has-chzn");
// Apply Chosen
applyChosen(this);
this._super();
}