From: Felix Nagel Date: Sat, 16 Apr 2011 15:37:35 +0000 (+0200) Subject: fixed: hover for disabled options, see https://github.com/fnagel/jquery-ui/issues/103 X-Git-Tag: selectmenu_v1.1.0~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=478749c789d3bed87835320658b0dd6c40bd5485;p=jquery-ui.git fixed: hover for disabled options, see https://github.com/fnagel/jquery-ui/issues/103 --- diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 93f1ac858..cfdafa979 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -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)) {