diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-11-09 17:42:11 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-11-26 10:26:12 +0100 |
commit | 324d54dd3283bb83c84de238927724ce8e29efcc (patch) | |
tree | 2ead9f56c8b638a579ee7c7d02cb889fe6e1c9a6 | |
parent | 4e03321fd7cb41ba43a945982de2cb636fd7c70e (diff) | |
download | jquery-ui-324d54dd3283bb83c84de238927724ce8e29efcc.tar.gz jquery-ui-324d54dd3283bb83c84de238927724ce8e29efcc.zip |
Dialog: Use $.isEmptyObject() to check if there a button-option properties
-rw-r--r-- | ui/jquery.ui.dialog.js | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 628139407..f536120d5 100644 --- a/ui/jquery.ui.dialog.js +++ b/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 ) ? |