Permalink
Browse files

Selectmenu: small fixes for lint tests

  • Loading branch information...
fnagel committed May 24, 2012
1 parent c3f6bd9 commit ec6d88fae464ffb432df6c8d2ed06ee9fa5b4dae
Showing with 5 additions and 4 deletions.
  1. +5 −4 ui/jquery.ui.selectmenu.js
@@ -166,7 +166,8 @@ $.widget( "ui.selectmenu", {
refresh: function() {
this.menu.empty();
- var options = this.element.find( 'option' );
+ var item,
+ options = this.element.find( 'option' );
if ( options.length ) {
this._readOptions( options );
this._renderMenu( this.menu, this.items );
@@ -178,7 +179,7 @@ $.widget( "ui.selectmenu", {
this.menuItems.find( 'a' ).attr( 'role', 'option' );
// select current item
- var item = this._getSelectedItem();
+ item = this._getSelectedItem();
this.menu.menu( "focus", null, item );
this._setSelected( item.data( "item.selectmenu" ) );
@@ -244,7 +245,7 @@ $.widget( "ui.selectmenu", {
currentOptgroup = "";
$.each( items, function( index, item ) {
- if ( item.optgroup != currentOptgroup ) {
+ if ( item.optgroup !== currentOptgroup ) {
$( '<li />', {
'class': 'ui-selectmenu-optgroup' + ( item.element.parent( "optgroup" ).attr( "disabled" ) ? ' ui-state-disabled' : '' ),
html: item.optgroup
@@ -416,7 +417,7 @@ $.widget( "ui.selectmenu", {
index: index,
value: option.attr( 'value' ),
label: option.text() || '&nbsp;',
- optgroup: optgroup.attr( "label" ) || false,
+ optgroup: optgroup.attr( "label" ) || "",
disabled: optgroup.attr( "disabled" ) || option.attr( "disabled" )
});
});

0 comments on commit ec6d88f

Please sign in to comment.