]> source.dussan.org Git - jquery-ui.git/commitdiff
fixed: hover for disabled options, see https://github.com/fnagel/jquery-ui/issues/103
authorFelix Nagel <info@felixnagel.com>
Sat, 16 Apr 2011 15:37:35 +0000 (17:37 +0200)
committerFelix Nagel <info@felixnagel.com>
Sat, 16 Apr 2011 15:37:35 +0000 (17:37 +0200)
ui/jquery.ui.selectmenu.js

index 93f1ac8581b6dcb8aeeba4fd21e9fc2695d8d8d7..cfdafa9790fed163ce04ee79be61c595de0c3237 100644 (file)
@@ -281,10 +281,13 @@ $.widget("ui.selectmenu", {
                                .bind("click.selectmenu", function() {
                                        return false;
                                })
-                               .bind('mouseover.selectmenu focus.selectmenu', function() { 
-                                       self._selectedOptionLi().addClass(activeClass); 
-                                       self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover'); 
-                                       $(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover'); 
+                               .bind('mouseover.selectmenu focus.selectmenu', function(e) {
+                                       // no hover if diabled
+                                       if (!$(e.currentTarget).hasClass(self.namespace + '-state-disabled')) {
+                                               self._selectedOptionLi().addClass(activeClass); 
+                                               self._focusedOptionLi().removeClass(self.widgetBaseClass + '-item-focus ui-state-hover'); 
+                                               $(this).removeClass('ui-state-active').addClass(self.widgetBaseClass + '-item-focus ui-state-hover'); 
+                                       }
                                })
                                .bind('mouseout.selectmenu blur.selectmenu', function() { 
                                        if ($(this).is(self._selectedOptionLi().selector)) {