diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.dialog.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index ff2375164..17300b178 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -357,10 +357,15 @@ $.widget("ui.dialog", { }); } if (hasButtons) { - $.each(buttons, function(name, fn) { - var button = $('<button type="button"></button>') - .text(name) - .click(function() { fn.apply(self.element[0], arguments); }) + $.each(buttons, function(name, props) { + props = $.isFunction( props ) ? + { click: props, text: name } : + props; + var button = $('<button></button>', props) + .unbind('click') + .click(function() { + props.click.apply(self.element[0], arguments); + }) .appendTo(uiButtonSet); if ($.fn.button) { button.button(); |