Permalink
Browse files

added list of allowed options for dialog buttons

  • Loading branch information...
1 parent 56e836b commit 1055c03fcdfea914a97a8997c59f1f96dc89f3a7 @alexeevdv alexeevdv committed Nov 16, 2012
Showing with 8 additions and 5 deletions.
  1. +8 −5 ui/jquery.ui.dialog.js
View
13 ui/jquery.ui.dialog.js
@@ -334,7 +334,7 @@ $.widget("ui.dialog", {
}
if ( hasButtons ) {
$.each( buttons, function( name, props ) {
- var button, click, opts;
+ var button, click, options;
props = $.isFunction( props ) ?
{ click: props, text: name } :
props;
@@ -345,11 +345,14 @@ $.widget("ui.dialog", {
props.click = function() {
click.apply( that.element[0], arguments );
};
- opts = {};
- if (props.icons) {
- opts.icons = props.icons;
- delete props.icons;
+ options = {};
+ optionsList = ["icons","disabled","showText", "label"];
+ for ( var i in optionsList) {
+ if (props[optionsList[i]]) {
+ options[optionsList[i]] = props[optionsList[i]];
+ delete props[optionsList[i]];
}
+ }
button = $( "<button></button>", props )
.appendTo( that.uiButtonSet );
if ( $.fn.button ) {

0 comments on commit 1055c03

Please sign in to comment.