@@ -42,7 +42,12 @@ $.widget( "ui.button", {
42
42
showLabel : true ,
43
43
label : null ,
44
44
icon : null ,
45
- iconPosition : "beginning"
45
+ iconPosition : "beginning" ,
46
+ classes : {
47
+ "ui-button" : "ui-corner-all" ,
48
+ "ui-button-icon-only" : null ,
49
+ "ui-button-icon" : null
50
+ }
46
51
} ,
47
52
48
53
_getCreateOptions : function ( ) {
@@ -118,11 +123,11 @@ $.widget( "ui.button", {
118
123
119
124
_updateIcon : function ( icon ) {
120
125
if ( ! this . icon ) {
121
- this . icon = $ ( "<span>" ) . addClass ( " ui-icon" ) ;
126
+ this . icon = $ ( "<span>" ) . addClass ( this . _classes ( "ui-button-icon" ) + " ui-icon" ) ;
122
127
this . element . addClass ( "ui-icon-" + this . options . iconPosition ) ;
123
128
124
129
if ( ! this . options . showLabel ) {
125
- this . element . addClass ( "ui-button-icon-only" ) ;
130
+ this . element . addClass ( this . _classes ( "ui-button-icon-only" ) ) ;
126
131
}
127
132
} else {
128
133
this . icon . removeClass ( this . options . icon ) ;
@@ -158,7 +163,7 @@ $.widget( "ui.button", {
158
163
// Make sure we cant end up with a button that has no text nor icon
159
164
if ( key === "showLabel" ) {
160
165
if ( ( ! value && ! this . options . icon ) || value ) {
161
- this . element . toggleClass ( "ui-button-icon-only" , ! value )
166
+ this . element . toggleClass ( this . _classes ( "ui-button-icon-only" ) , ! value )
162
167
. toggleClass ( this . options . iconPosition , ! ! value ) ;
163
168
this . _updateTooltip ( ) ;
164
169
} else {
0 commit comments