File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ $.widget( "ui.button", {
3434 var self = this ,
3535 options = this . options ,
3636 toggleButton = this . type === "checkbox" || this . type === "radio" ,
37- hoverClass = "ui-state-hover" + ( ! toggleButton ? " ui-state-active" : "" ) ;
37+ hoverClass = "ui-state-hover" + ( ! toggleButton ? " ui-state-active" : "" ) ,
38+ focusClass = "ui-state-focus" ;
3839
3940 if ( options . label === null ) {
4041 options . label = this . buttonElement . html ( ) ;
@@ -57,6 +58,13 @@ $.widget( "ui.button", {
5758 return ;
5859 }
5960 $ ( this ) . removeClass ( hoverClass ) ;
61+ } )
62+ . bind ( "focus.button" , function ( ) {
63+ // no need to check disabled, focus won't be triggered anyway
64+ $ ( this ) . addClass ( focusClass ) ;
65+ } )
66+ . bind ( "blur.button" , function ( ) {
67+ $ ( this ) . removeClass ( focusClass ) ;
6068 } ) ;
6169
6270 if ( this . type === "checkbox" ) {
You can’t perform that action at this time.
0 commit comments