mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Don't use .attr( props, true ).
(cherry picked from commit a8de99c791
)
This commit is contained in:
parent
8f0daea9eb
commit
ccb741bd0c
15
ui/jquery.ui.dialog.js
vendored
15
ui/jquery.ui.dialog.js
vendored
@ -369,15 +369,18 @@ $.widget("ui.dialog", {
|
|||||||
}
|
}
|
||||||
if ( hasButtons ) {
|
if ( hasButtons ) {
|
||||||
$.each( buttons, function( name, props ) {
|
$.each( buttons, function( name, props ) {
|
||||||
|
var button, click;
|
||||||
props = $.isFunction( props ) ?
|
props = $.isFunction( props ) ?
|
||||||
{ click: props, text: name } :
|
{ click: props, text: name } :
|
||||||
props;
|
props;
|
||||||
var button = $( "<button type='button'></button>" )
|
// Default to a non-submitting button
|
||||||
.attr( props, true )
|
props = $.extend( { type: "button" }, props );
|
||||||
.unbind( "click" )
|
// Change the context for the click callback to be the main element
|
||||||
.click(function() {
|
click = props.click;
|
||||||
props.click.apply( that.element[0], arguments );
|
props.click = function() {
|
||||||
})
|
click.apply( that.element[0], arguments );
|
||||||
|
};
|
||||||
|
button = $( "<button></button>", props )
|
||||||
.appendTo( that.uiButtonSet );
|
.appendTo( that.uiButtonSet );
|
||||||
if ( $.fn.button ) {
|
if ( $.fn.button ) {
|
||||||
button.button();
|
button.button();
|
||||||
|
Loading…
Reference in New Issue
Block a user