From 6ff94ff18ba7bc8d87579fab2a671991f497f1ff Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sun, 17 Apr 2011 23:09:24 +0200 Subject: [PATCH] fixed: follow-up fix for disabling / enabling functionality, thx to gcko fro reporting, see https://github.com/fnagel/jquery-ui/issues/105 fixed: small issue in disable_enable.html demo file --- demos/selectmenu/disable_enable.html | 2 +- ui/jquery.ui.selectmenu.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/demos/selectmenu/disable_enable.html b/demos/selectmenu/disable_enable.html index f54d47870..ac49e9e3b 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", 0); + speedB2.selectmenu("disable", 2); }, function(){ speedB2.selectmenu("enable", 2); diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index a5992b1a4..1efa6b630 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -453,9 +453,9 @@ $.widget("ui.selectmenu", { }); // if we didnt find it clear the prevChar - if (!focusFound) { + // if (!focusFound) { //self._prevChar = undefined - } + // } // set a 1 second timeout for sequenctial typeahead // keep this set even if we have no matches so it doesnt typeahead somewhere else @@ -639,8 +639,8 @@ $.widget("ui.selectmenu", { }, disable: function(index, type){ - //if options is not provided, call the parents disable function - if ( index === null ) { + // if options is not provided, call the parents disable function + if ( typeof( index ) == 'undefined' ) { this._setOption( 'disabled', true ); } else { if ( type == "optgroup" ) { @@ -652,8 +652,8 @@ $.widget("ui.selectmenu", { }, enable: function(index, type) { - //if options is not provided, call the parents enable function - if ( !index ) { + // if options is not provided, call the parents enable function + if ( typeof( index ) == 'undefined' ) { this._setOption('disabled', false); } else { if ( type == "optgroup" ) { -- 2.39.5