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