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", {
82
82
this . options . disabled = this . element . prop ( "disabled" ) || false ;
83
83
}
84
84
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 ( ) {
85
99
this . _setOption ( "disabled" , this . options . disabled ) ;
86
100
87
101
this . element . addClass ( baseClasses ) . attr ( "role" , "button" ) ;
@@ -94,20 +108,9 @@ $.widget( "ui.button", {
94
108
this . element . html ( this . options . label ) ;
95
109
}
96
110
}
97
-
98
111
if ( this . options . icon ) {
99
112
this . _updateIcon ( this . options . icon ) . _updateTooltip ( ) ;
100
113
}
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
- }
111
114
} ,
112
115
113
116
_updateTooltip : function ( ) {
You can’t perform that action at this time.
0 commit comments