Skip to content
This repository

Showing 1 changed file with 13 additions and 9 deletions. Show diff stats Hide diff stats

  1. 22  admin/javascript/LeftAndMain.js
22  admin/javascript/LeftAndMain.js
@@ -20,16 +20,20 @@ jQuery.noConflict();
20 20
 		
21 21
 		// apply an select element only when it is ready, ie. when it is rendered into a template
22 22
 		// with css applied and got a width value.
23  
-		var applyChosen = function(el){
24  
-			if(el.outerWidth()){
25  
-				el.chosen({
26  
-					'disable_search_threshold' : 20,
27  
-					'allow_single_deselect': true
28  
-				}).addClass("has-chzn");
29  
-				// Copy over title attribute if required
30  
-				if(el.attr('title')) el.siblings('.chzn-container').attr('title', el.attr('title'));
  23
+		var applyChosen = function(el) {
  24
+			if(el.is(':visible')) {
  25
+				el.addClass('has-chzn').chosen({
  26
+					allow_single_deselect: true,
  27
+					disable_search_threshold: 20
  28
+				});
  29
+
  30
+				var title = el.prop('title')
  31
+
  32
+				if(title) {
  33
+					el.siblings('.chzn-container').prop('title', title);
  34
+				}
31 35
 			} else {
32  
-				setTimeout(function() {applyChosen(el);},500);
  36
+				setTimeout(function() { applyChosen(el); }, 500);
33 37
 			}
34 38
 		};
35 39
 

0 notes on commit 2503e48

Please sign in to comment.
Something went wrong with that request. Please try again.