We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 329507f commit cac5accCopy full SHA for cac5acc
ui/jquery.ui.dialog.js
@@ -365,20 +365,13 @@ $.widget("ui.dialog", {
365
},
366
367
_createButtons: function( buttons ) {
368
- var that = this,
369
- hasButtons = false;
+ var that = this;
370
371
// if we already have a button pane, remove it
372
this.uiDialogButtonPane.remove();
373
this.uiButtonSet.empty();
374
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 ) {
+ if ( !$.isEmptyObject( buttons ) ) {
382
$.each( buttons, function( name, props ) {
383
var button, click;
384
props = $.isFunction( props ) ?
0 commit comments