From 478749c789d3bed87835320658b0dd6c40bd5485 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Sat, 16 Apr 2011 17:37:35 +0200 Subject: [PATCH] fixed: hover for disabled options, see https://github.com/fnagel/jquery-ui/issues/103 --- ui/jquery.ui.selectmenu.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)) { -- 2.39.5