]> source.dussan.org Git - jquery-ui.git/commitdiff
fixed: follow-up fix for disabling / enabling functionality, thx to gcko fro reportin...
authorFelix Nagel <info@felixnagel.com>
Sun, 17 Apr 2011 21:09:24 +0000 (23:09 +0200)
committerFelix Nagel <info@felixnagel.com>
Sun, 17 Apr 2011 21:09:24 +0000 (23:09 +0200)
fixed: small issue in disable_enable.html demo file

demos/selectmenu/disable_enable.html
ui/jquery.ui.selectmenu.js

index f54d47870258a31ccdac94b12dabac6e75b4da76..ac49e9e3b8425f30b8fb5b96f763fa3f3a1369db 100644 (file)
@@ -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);
index a5992b1a40351c9eef1984716ca7ab5bdf397b7a..1efa6b6306259a229016abddf6116367e0134a1f 100644 (file)
@@ -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" ) {