From: Jörn Zaefferer Date: Thu, 22 Nov 2012 09:39:45 +0000 (+0100) Subject: Dialog: Follow-up to c77ca67 - exclude button options from properties to create the... X-Git-Tag: 1.10.0-beta.1~92 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ec1f1bde76c555e7643899c5bbbb200353f780ea;p=jquery-ui.git Dialog: Follow-up to c77ca67 - exclude button options from properties to create the button. --- diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index b9f73e954..ea5226ac5 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -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; $( "", props ) - .button({ - icons: props.icons, - text: props.showText - }) + .button( buttonOptions ) .appendTo( that.uiButtonSet ); }); this.uiDialog.addClass( "ui-dialog-buttons" );