Skip to content

Commit 17fc2e9

Browse files
committed
some code clean up
1 parent 3d8f6f0 commit 17fc2e9

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -337,39 +337,39 @@ $.widget("ui.selectmenu", {
337337
}
338338

339339
// 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' );
341341
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 );
344344
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 )
347347
// 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' );
352352
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 );
355355

356356
// 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 );
360360
}
361361

362362
// 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 );
365365
} 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 );
367367
}
368368

369369
// reset height to auto
370370
this.list.css("height", "auto");
371371
var listH = this.list.height();
372-
372+
// calculate default max height
373373
if ( o.maxHeight && o.maxHeight < listH) {
374374
this.list.height( o.maxHeight );
375375
} else {
@@ -378,7 +378,7 @@ $.widget("ui.selectmenu", {
378378
}
379379

380380
// 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)' );
382382

383383
// transfer disabled state
384384
if ( this.element.attr( 'disabled' ) === true ) {
@@ -388,12 +388,12 @@ $.widget("ui.selectmenu", {
388388
}
389389

390390
// update value
391-
this.index(this._selectedIndex());
391+
this.index( this._selectedIndex() );
392392

393393
// needed when selectmenu is placed at the very bottom / top of the page
394-
window.setTimeout(function() {
394+
window.setTimeout( function() {
395395
self._refreshPosition();
396-
}, 200);
396+
}, 200 );
397397
},
398398

399399
destroy: function() {

0 commit comments

Comments
 (0)