File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 55
66module ( "button: tickets" ) ;
77
8+ test ( "#5295 - button does not remove hoverstate if disabled" , function ( ) {
9+ expect ( 1 ) ;
10+ var btn = $ ( "#button" ) . button ( ) ;
11+ btn . hover ( function ( ) {
12+ btn . button ( "disable" ) ;
13+ } ) ;
14+ btn . trigger ( "mouseenter" ) ;
15+ btn . trigger ( "mouseleave" ) ;
16+ ok ( ! btn . is ( ".ui-state-hover" ) ) ;
17+ } ) ;
18+
819test ( "#5946 - buttonset should ignore buttons that are not :visible" , function ( ) {
920 expect ( 2 ) ;
1021 $ ( "#radio01" ) . next ( ) . andSelf ( ) . hide ( ) ;
Original file line number Diff line number Diff line change @@ -70,21 +70,22 @@ $.widget( "ui.button", {
7070 var that = this ,
7171 options = this . options ,
7272 toggleButton = this . type === "checkbox" || this . type === "radio" ,
73- hoverClass = "ui-state-hover" + ( ! toggleButton ? " ui-state-active" : "" ) ,
73+ activeClass = ! toggleButton ? "ui-state-active" : "" ,
7474 focusClass = "ui-state-focus" ;
7575
7676 if ( options . label === null ) {
7777 options . label = ( this . type === "input" ? this . buttonElement . val ( ) : this . buttonElement . html ( ) ) ;
7878 }
7979
80+ this . _hoverable ( this . buttonElement ) ;
81+
8082 this . buttonElement
8183 . addClass ( baseClasses )
8284 . attr ( "role" , "button" )
8385 . bind ( "mouseenter" + this . eventNamespace , function ( ) {
8486 if ( options . disabled ) {
8587 return ;
8688 }
87- $ ( this ) . addClass ( "ui-state-hover" ) ;
8889 if ( this === lastActive ) {
8990 $ ( this ) . addClass ( "ui-state-active" ) ;
9091 }
@@ -93,7 +94,7 @@ $.widget( "ui.button", {
9394 if ( options . disabled ) {
9495 return ;
9596 }
96- $ ( this ) . removeClass ( hoverClass ) ;
97+ $ ( this ) . removeClass ( activeClass ) ;
9798 } )
9899 . bind ( "click" + this . eventNamespace , function ( event ) {
99100 if ( options . disabled ) {
You can’t perform that action at this time.
0 commit comments