mirror of
https://github.com/jquery/jquery-ui.git
synced 2026-04-20 03:02:41 -04:00
Dialog: Follow-up to c77ca67 - exclude button options from properties to create the button.
This commit is contained in:
13
ui/jquery.ui.dialog.js
vendored
13
ui/jquery.ui.dialog.js
vendored
@@ -376,7 +376,7 @@ $.widget("ui.dialog", {
|
||||
|
||||
if ( !$.isEmptyObject( buttons ) ) {
|
||||
$.each( buttons, function( name, props ) {
|
||||
var click;
|
||||
var click, buttonOptions;
|
||||
props = $.isFunction( props ) ?
|
||||
{ click: props, text: name } :
|
||||
props;
|
||||
@@ -387,11 +387,14 @@ $.widget("ui.dialog", {
|
||||
props.click = function() {
|
||||
click.apply( that.element[0], arguments );
|
||||
};
|
||||
buttonOptions = {
|
||||
icons: props.icons,
|
||||
text: props.showText
|
||||
};
|
||||
delete props.icons;
|
||||
delete props.showText;
|
||||
$( "<button></button>", props )
|
||||
.button({
|
||||
icons: props.icons,
|
||||
text: props.showText
|
||||
})
|
||||
.button( buttonOptions )
|
||||
.appendTo( that.uiButtonSet );
|
||||
});
|
||||
this.uiDialog.addClass( "ui-dialog-buttons" );
|
||||
|
||||
Reference in New Issue
Block a user