Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 7a27832297bb02b63930f5ace3af37488583a991 1 parent a95b11d
Normann Lou normann authored chillu committed
Showing with 12 additions and 2 deletions.
  1. +12 −2 admin/javascript/LeftAndMain.js
14 admin/javascript/LeftAndMain.js
View
@@ -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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.