Skip to content

Commit

Permalink
Dialog: Don't use .attr( props, true ).
Browse files Browse the repository at this point in the history
(cherry picked from commit a8de99c)
  • Loading branch information
scottgonzalez committed Nov 8, 2012
1 parent 8f0daea commit ccb741b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ui/jquery.ui.dialog.js
Expand Up @@ -369,15 +369,18 @@ $.widget("ui.dialog", {
}
if ( hasButtons ) {
$.each( buttons, function( name, props ) {
var button, click;
props = $.isFunction( props ) ?
{ click: props, text: name } :
props;
var button = $( "<button type='button'></button>" )
.attr( props, true )
.unbind( "click" )
.click(function() {
props.click.apply( that.element[0], arguments );
})
// Default to a non-submitting button
props = $.extend( { type: "button" }, props );
// Change the context for the click callback to be the main element
click = props.click;
props.click = function() {
click.apply( that.element[0], arguments );
};
button = $( "<button></button>", props )
.appendTo( that.uiButtonSet );
if ( $.fn.button ) {
button.button();
Expand Down

0 comments on commit ccb741b

Please sign in to comment.