aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-09 17:42:11 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 10:26:12 +0100
commit324d54dd3283bb83c84de238927724ce8e29efcc (patch)
tree2ead9f56c8b638a579ee7c7d02cb889fe6e1c9a6
parent4e03321fd7cb41ba43a945982de2cb636fd7c70e (diff)
downloadjquery-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.js11
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 ) ?