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