From: Felix Nagel Date: Sat, 16 Apr 2011 15:43:44 +0000 (+0200) Subject: fixed: small bug when using method disable with parameter 0, thx to scottriding,... X-Git-Tag: selectmenu_v1.1.0~17 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fc78c0d67fb1961252c721df90501ea85e53e375;p=jquery-ui.git fixed: small bug when using method disable with parameter 0, thx to scottriding, see https://github.com/fnagel/jquery-ui/pull/93 --- diff --git a/demos/selectmenu/disable_enable.html b/demos/selectmenu/disable_enable.html index ac49e9e3b..f54d47870 100644 --- a/demos/selectmenu/disable_enable.html +++ b/demos/selectmenu/disable_enable.html @@ -57,7 +57,7 @@ var speedB2 = $('select#speedB2').selectmenu(); $("#optionSwitch").toggle( function(){ - speedB2.selectmenu("disable", 2); + speedB2.selectmenu("disable", 0); }, function(){ speedB2.selectmenu("enable", 2); diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index cfdafa979..9cd018477 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -639,7 +639,7 @@ $.widget("ui.selectmenu", { disable: function(index, type){ //if options is not provided, call the parents disable function - if ( !index ) { + if ( index === null ) { this._setOption( 'disabled', true ); } else { if ( type == "optgroup" ) {