Skip to content

Commit cac5acc

Browse files
committed
Dialog: Use $.isEmptyObject() to check if there a button-option properties
1 parent 329507f commit cac5acc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

ui/jquery.ui.dialog.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -365,20 +365,13 @@ $.widget("ui.dialog", {
365365
},
366366

367367
_createButtons: function( buttons ) {
368-
var that = this,
369-
hasButtons = false;
368+
var that = this;
370369

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

375-
// TODO use jQuery.isEmptyObject()
376-
if ( typeof buttons === "object" && buttons !== null ) {
377-
$.each( buttons, function() {
378-
return !(hasButtons = true);
379-
});
380-
}
381-
if ( hasButtons ) {
374+
if ( !$.isEmptyObject( buttons ) ) {
382375
$.each( buttons, function( name, props ) {
383376
var button, click;
384377
props = $.isFunction( props ) ?

0 commit comments

Comments
 (0)