Skip to content
Permalink
Browse files

Dialog: Use $.isEmptyObject() to check if there a button-option prope…

…rties
  • Loading branch information...
jzaefferer committed Nov 9, 2012
1 parent 4e03321 commit 324d54dd3283bb83c84de238927724ce8e29efcc
Showing with 2 additions and 9 deletions.
  1. +2 −9 ui/jquery.ui.dialog.js
@@ -365,20 +365,13 @@ $.widget("ui.dialog", {
},

_createButtons: function( buttons ) {
var that = this,
hasButtons = false;
var that = this;

// if we already have a button pane, remove it
this.uiDialogButtonPane.remove();
this.uiButtonSet.empty();

// TODO use jQuery.isEmptyObject()
if ( typeof buttons === "object" && buttons !== null ) {
$.each( buttons, function() {
return !(hasButtons = true);
});
}
if ( hasButtons ) {
if ( !$.isEmptyObject( buttons ) ) {
$.each( buttons, function( name, props ) {
var button, click;
props = $.isFunction( props ) ?

0 comments on commit 324d54d

Please sign in to comment.
You can’t perform that action at this time.