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", {
289289 . appendTo ( buttonElement . empty ( ) )
290290 . text ( ) ,
291291 icons = this . options . icons ,
292- multipleIcons = icons . primary && icons . secondary ;
292+ multipleIcons = icons . primary && icons . secondary ,
293+ buttonClasses = [ ] ;
294+
293295 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+
296298 if ( icons . primary ) {
297299 buttonElement . prepend ( "<span class='ui-button-icon-primary ui-icon " + icons . primary + "'></span>" ) ;
298300 }
301+
299302 if ( icons . secondary ) {
300303 buttonElement . append ( "<span class='ui-button-icon-secondary ui-icon " + icons . secondary + "'></span>" ) ;
301304 }
305+
302306 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+
306310 if ( ! this . hasTitle ) {
307311 buttonElement . attr ( "title" , buttonText ) ;
308312 }
309313 }
310314 } else {
311- buttonElement . addClass ( "ui-button-text-only" ) ;
315+ buttonClasses . push ( "ui-button-text-only" ) ;
312316 }
317+ buttonElement . addClass ( buttonClasses . join ( " " ) ) ;
313318 }
314319} ) ;
315320
You can’t perform that action at this time.
0 commit comments