File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 153
153
// Contains the current instance of Chosen class
154
154
var lis = $ ( chosen . container ) . find ( '.chzn-drop ul li' )
155
155
var options = $ ( chosen . form_field ) . find ( 'optgroup, option:not(:empty)' ) ;
156
-
157
- for ( var i = 0 ; i < lis . length ; i ++ ) {
158
- var li = lis [ i ] ;
159
- var option = options [ i ] ;
160
- var img_src = $ ( option ) . attr ( 'data-img-src' ) ;
161
-
162
- if ( typeof img_src != 'undefined' && img_src != '' ) {
163
- var template = html_template . replace ( '{url}' , img_src ) ;
164
- // SS uses a modified Chosen.js and after the 'showing_dropdown' event the
165
- // values get immediatelly reset, also removing the images. Solved it with setTimeout.
166
- setTimeout ( function ( li , template ) {
156
+
157
+ // SS uses a modified Chosen.js and after the 'showing_dropdown' event the
158
+ // values get immediatelly reset, also removing the images. Solved it with setTimeout.
159
+ setTimeout ( function ( lis , options ) {
160
+ for ( var i = 0 ; i < lis . length ; i ++ ) {
161
+ var li = lis [ i ] ;
162
+ var option = options [ i ] ;
163
+ var img_src = $ ( option ) . attr ( 'data-img-src' ) ;
164
+
165
+ if ( typeof img_src != 'undefined' && img_src != '' ) {
166
+ var template = html_template . replace ( '{url}' , img_src ) ;
167
167
$ ( li ) . prepend ( template . replace ( '{class_name}' , 'chose-image-list' ) ) ;
168
- } , 1 , li , template ) ;
168
+ }
169
169
}
170
- }
170
+ } , 1 , lis , options ) ;
171
171
} ) ;
172
172
} ) ;
173
173
$this . trigger ( 'liszt:hiding_dropdown' ) ;
You can’t perform that action at this time.
0 commit comments