]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Follow-up to c77ca67 - exclude button options from properties to create the...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Thu, 22 Nov 2012 09:39:45 +0000 (10:39 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 26 Nov 2012 09:28:25 +0000 (10:28 +0100)
ui/jquery.ui.dialog.js

index b9f73e954cd8a7b1b2b034be9e2117cc205e2fab..ea5226ac5ff94235ab0c0d93b23f045cdd14e208 100644 (file)
@@ -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" );