File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,20 @@ $.widget( "ui.button", {
8282 this . options . disabled = this . element . prop ( "disabled" ) || false ;
8383 }
8484
85+ this . _enhance ( ) ;
86+
87+ if ( this . element . is ( "a" ) ) {
88+ this . _on ( {
89+ "keyup" : function ( event ) {
90+ if ( event . keyCode === $ . ui . keyCode . SPACE ) {
91+ this . element [ 0 ] . click ( ) ;
92+ }
93+ }
94+ } ) ;
95+ }
96+ } ,
97+
98+ _enhance : function ( ) {
8599 this . _setOption ( "disabled" , this . options . disabled ) ;
86100
87101 this . element . addClass ( baseClasses ) . attr ( "role" , "button" ) ;
@@ -94,20 +108,9 @@ $.widget( "ui.button", {
94108 this . element . html ( this . options . label ) ;
95109 }
96110 }
97-
98111 if ( this . options . icon ) {
99112 this . _updateIcon ( this . options . icon ) . _updateTooltip ( ) ;
100113 }
101-
102- if ( this . element . is ( "a" ) ) {
103- this . _on ( {
104- "keyup" : function ( event ) {
105- if ( event . keyCode === $ . ui . keyCode . SPACE ) {
106- this . element [ 0 ] . click ( ) ;
107- }
108- }
109- } ) ;
110- }
111114 } ,
112115
113116 _updateTooltip : function ( ) {
You can’t perform that action at this time.
0 commit comments