Skip to content

Commit ec1f1bd

Browse files
committed
Dialog: Follow-up to c77ca67 - exclude button options from properties to create the button.
1 parent a09f5c0 commit ec1f1bd

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

ui/jquery.ui.dialog.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ $.widget("ui.dialog", {
376376

377377
if ( !$.isEmptyObject( buttons ) ) {
378378
$.each( buttons, function( name, props ) {
379-
var click;
379+
var click, buttonOptions;
380380
props = $.isFunction( props ) ?
381381
{ click: props, text: name } :
382382
props;
@@ -387,11 +387,14 @@ $.widget("ui.dialog", {
387387
props.click = function() {
388388
click.apply( that.element[0], arguments );
389389
};
390+
buttonOptions = {
391+
icons: props.icons,
392+
text: props.showText
393+
};
394+
delete props.icons;
395+
delete props.showText;
390396
$( "<button></button>", props )
391-
.button({
392-
icons: props.icons,
393-
text: props.showText
394-
})
397+
.button( buttonOptions )
395398
.appendTo( that.uiButtonSet );
396399
});
397400
this.uiDialog.addClass( "ui-dialog-buttons" );

0 commit comments

Comments
 (0)