@@ -337,39 +337,39 @@ $.widget("ui.selectmenu", {
337
337
}
338
338
339
339
// we need to set and unset the CSS classes for dropdown and popup style
340
- var isDropDown = ( o . style == 'dropdown' ) ;
340
+ var isDropDown = ( o . style == 'dropdown' ) ;
341
341
this . newelement
342
- . toggleClass ( self . widgetBaseClass + " -dropdown" , isDropDown )
343
- . toggleClass ( self . widgetBaseClass + " -popup" , ! isDropDown ) ;
342
+ . toggleClass ( self . widgetBaseClass + ' -dropdown' , isDropDown )
343
+ . toggleClass ( self . widgetBaseClass + ' -popup' , ! isDropDown ) ;
344
344
this . list
345
- . toggleClass ( self . widgetBaseClass + " -menu-dropdown ui-corner-bottom" , isDropDown )
346
- . toggleClass ( self . widgetBaseClass + " -menu-popup ui-corner-all" , ! isDropDown )
345
+ . toggleClass ( self . widgetBaseClass + ' -menu-dropdown ui-corner-bottom' , isDropDown )
346
+ . toggleClass ( self . widgetBaseClass + ' -menu-popup ui-corner-all' , ! isDropDown )
347
347
// add corners to top and bottom menu items
348
- . find ( 'li:first' )
349
- . toggleClass ( " ui-corner-top" , ! isDropDown )
350
- . end ( ) . find ( 'li:last' )
351
- . addClass ( " ui-corner-bottom" ) ;
348
+ . find ( 'li:first' )
349
+ . toggleClass ( ' ui-corner-top' , ! isDropDown )
350
+ . end ( ) . find ( 'li:last' )
351
+ . addClass ( ' ui-corner-bottom' ) ;
352
352
this . selectmenuIcon
353
- . toggleClass ( 'ui-icon-triangle-1-s' , isDropDown )
354
- . toggleClass ( 'ui-icon-triangle-2-n-s' , ! isDropDown ) ;
353
+ . toggleClass ( 'ui-icon-triangle-1-s' , isDropDown )
354
+ . toggleClass ( 'ui-icon-triangle-2-n-s' , ! isDropDown ) ;
355
355
356
356
// transfer classes to selectmenu and list
357
- if ( o . transferClasses ) {
358
- var transferClasses = this . element . attr ( 'class' ) || '' ;
359
- this . newelement . add ( this . list ) . addClass ( transferClasses ) ;
357
+ if ( o . transferClasses ) {
358
+ var transferClasses = this . element . attr ( 'class' ) || '' ;
359
+ this . newelement . add ( this . list ) . addClass ( transferClasses ) ;
360
360
}
361
361
362
362
// set menu width to either menuWidth option value, width option value, or select width
363
- if ( o . style == 'dropdown' ) {
364
- this . list . width ( o . menuWidth ? o . menuWidth : o . width ) ;
363
+ if ( o . style == 'dropdown' ) {
364
+ this . list . width ( o . menuWidth ? o . menuWidth : o . width ) ;
365
365
} else {
366
- this . list . width ( o . menuWidth ? o . menuWidth : o . width - o . handleWidth ) ;
366
+ this . list . width ( o . menuWidth ? o . menuWidth : o . width - o . handleWidth ) ;
367
367
}
368
368
369
369
// reset height to auto
370
370
this . list . css ( "height" , "auto" ) ;
371
371
var listH = this . list . height ( ) ;
372
-
372
+ // calculate default max height
373
373
if ( o . maxHeight && o . maxHeight < listH ) {
374
374
this . list . height ( o . maxHeight ) ;
375
375
} else {
@@ -378,7 +378,7 @@ $.widget("ui.selectmenu", {
378
378
}
379
379
380
380
// save reference to actionable li's (not group label li's)
381
- this . _optionLis = this . list . find ( 'li:not(.' + self . widgetBaseClass + '-group)' ) ;
381
+ this . _optionLis = this . list . find ( 'li:not(.' + self . widgetBaseClass + '-group)' ) ;
382
382
383
383
// transfer disabled state
384
384
if ( this . element . attr ( 'disabled' ) === true ) {
@@ -388,12 +388,12 @@ $.widget("ui.selectmenu", {
388
388
}
389
389
390
390
// update value
391
- this . index ( this . _selectedIndex ( ) ) ;
391
+ this . index ( this . _selectedIndex ( ) ) ;
392
392
393
393
// needed when selectmenu is placed at the very bottom / top of the page
394
- window . setTimeout ( function ( ) {
394
+ window . setTimeout ( function ( ) {
395
395
self . _refreshPosition ( ) ;
396
- } , 200 ) ;
396
+ } , 200 ) ;
397
397
} ,
398
398
399
399
destroy : function ( ) {
0 commit comments