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 ) {
|
_createButtons: function( buttons ) {
|
||||||
var that = this,
|
var that = this;
|
||||||
hasButtons = false;
|
|
||||||
|
|
||||||
// if we already have a button pane, remove it
|
// if we already have a button pane, remove it
|
||||||
this.uiDialogButtonPane.remove();
|
this.uiDialogButtonPane.remove();
|
||||||
this.uiButtonSet.empty();
|
this.uiButtonSet.empty();
|
||||||
|
|
||||||
// TODO use jQuery.isEmptyObject()
|
if ( !$.isEmptyObject( buttons ) ) {
|
||||||
if ( typeof buttons === "object" && buttons !== null ) {
|
|
||||||
$.each( buttons, function() {
|
|
||||||
return !(hasButtons = true);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if ( hasButtons ) {
|
|
||||||
$.each( buttons, function( name, props ) {
|
$.each( buttons, function( name, props ) {
|
||||||
var button, click;
|
var button, click;
|
||||||
props = $.isFunction( props ) ?
|
props = $.isFunction( props ) ?
|
||||||
|
Loading…
Reference in New Issue
Block a user