mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Dialog: Use $.isEmptyObject() to check if there a button-option properties
This commit is contained in:
parent
4e03321fd7
commit
324d54dd32
11
ui/jquery.ui.dialog.js
vendored
11
ui/jquery.ui.dialog.js
vendored
@ -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 ) ?
|
||||
|
Loading…
Reference in New Issue
Block a user