File tree 1 file changed +12
-7
lines changed
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -290,27 +290,32 @@ $.widget( "ui.button", {
290
290
. appendTo ( buttonElement . empty ( ) )
291
291
. text ( ) ,
292
292
icons = this . options . icons ,
293
- multipleIcons = icons . primary && icons . secondary ;
293
+ multipleIcons = icons . primary && icons . secondary ,
294
+ buttonClasses = [ ] ;
295
+
294
296
if ( icons . primary || icons . secondary ) {
295
- buttonElement . addClass ( "ui-button-text-icon" +
296
- ( multipleIcons ? "s" : ( icons . primary ? "-primary" : "-secondary" ) ) ) ;
297
+ buttonClasses . push ( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons . primary ? "-primary" : "-secondary" ) ) ) ;
298
+
297
299
if ( icons . primary ) {
298
300
buttonElement . prepend ( "<span class='ui-button-icon-primary ui-icon " + icons . primary + "'></span>" ) ;
299
301
}
302
+
300
303
if ( icons . secondary ) {
301
304
buttonElement . append ( "<span class='ui-button-icon-secondary ui-icon " + icons . secondary + "'></span>" ) ;
302
305
}
306
+
303
307
if ( ! this . options . text ) {
304
- buttonElement
305
- . addClass ( multipleIcons ? "ui-button-icons-only" : " ui-button-icon-only " )
306
- . removeClass ( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" ) ;
308
+ buttonClasses . push ( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ) ;
309
+ buttonElement . removeClass ( "ui-button-text- icons ui-button-text-icon-primary ui-button-text- icon-secondary " ) ;
310
+
307
311
if ( ! this . hasTitle ) {
308
312
buttonElement . attr ( "title" , buttonText ) ;
309
313
}
310
314
}
311
315
} else {
312
- buttonElement . addClass ( "ui-button-text-only" ) ;
316
+ buttonClasses . push ( "ui-button-text-only" ) ;
313
317
}
318
+ buttonElement . addClass ( buttonClasses . join ( " " ) ) ;
314
319
}
315
320
} ) ;
316
321
You can’t perform that action at this time.
0 commit comments