File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,14 @@ $.widget( "ui.button", {
83
83
. addClass ( baseClasses )
84
84
. attr ( "role" , "button" ) ;
85
85
86
+ if ( this . options . label ) {
87
+ if ( this . isInput ) {
88
+ this . element . val ( this . options . label ) ;
89
+ } else {
90
+ this . element . html ( this . options . label ) ;
91
+ }
92
+ }
93
+
86
94
if ( this . options . icon ) {
87
95
this . icon = $ ( "<span>" ) ;
88
96
this . icon . addClass ( " ui-icon " + this . options . icon ) ;
@@ -95,20 +103,6 @@ $.widget( "ui.button", {
95
103
this . element . append ( this . icon ) ;
96
104
this . _setTitle ( ) ;
97
105
}
98
- if ( this . options . label ) {
99
- if ( this . isInput ) {
100
- this . element . val ( this . options . label ) ;
101
- } else {
102
- var textNode = this . element . contents ( ) . filter ( function ( ) {
103
- return this . nodeType === 3 ;
104
- } ) [ 0 ] ;
105
- if ( textNode !== undefined ) {
106
- textNode . nodeValue = this . options . label ;
107
- } else {
108
- this . element . html ( this . options . label + this . element . html ( ) ) ;
109
- }
110
- }
111
- }
112
106
113
107
if ( this . element . is ( "a" ) ) {
114
108
this . element . keyup ( function ( event ) {
You can’t perform that action at this time.
0 commit comments