File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 181
181
// show/hide optgroups
182
182
$groups . each ( function ( ) {
183
183
var $this = $ ( this ) ;
184
- if ( ! $this . children ( 'li' ) . filter ( ':visible' ) . length )
184
+ if ( ! $this . find ( 'li' ) . filter ( ':visible' ) . length )
185
185
$this . hide ( ) ;
186
186
} ) ;
187
187
this . instance . _setMenuHeight ( ) ;
Original file line number Diff line number Diff line change 307
307
} ) ;
308
308
309
309
// Build the list section for this optgroup, complete w/ option inputs...
310
- var $optionGroup = $ ( document . createElement ( 'ul' ) )
311
- . addClass ( 'ui-multiselect-optgroup'
312
- + ( self . options . groupColumns ? ' ui-multiselect-columns' : '' )
313
- + ( elem . className && ' ' ) + elem . className )
314
- . append ( $ ( document . createElement ( 'a' ) ) . text ( elem . getAttribute ( 'label' ) ) , options ) ;
315
-
316
- list . push ( $optionGroup ) ;
310
+ var $optGroupLabel = $ ( document . createElement ( 'a' ) ) . text ( elem . getAttribute ( 'label' ) ) ;
311
+ var $optGroupItem = $ ( document . createElement ( 'li' ) )
312
+ . addClass ( 'ui-multiselect-optgroup'
313
+ + ( self . options . groupColumns ? ' ui-multiselect-columns' : '' )
314
+ + ( elem . className && ' ' ) + elem . className )
315
+ var $optionGroup = $ ( document . createElement ( 'ul' ) ) . append ( options )
316
+ $optGroupItem . append ( $optGroupLabel , $optionGroup )
317
+
318
+ list . push ( $optGroupItem ) ;
317
319
}
318
320
else {
319
321
list . push ( self . _makeOption ( elem ) ) ;
474
476
e . preventDefault ( ) ;
475
477
476
478
var $this = $ ( this ) ;
477
- var $inputs = $this . parent ( ) . find ( 'input' ) . filter ( ':visible:not(:disabled)' ) ;
479
+ var $inputs = $this . next ( 'ul' ) . find ( 'input' ) . filter ( ':visible:not(:disabled)' ) ;
478
480
var nodes = $inputs . get ( ) ;
479
481
var label = this . textContent ;
480
482
You can’t perform that action at this time.
0 commit comments