From 324d54dd3283bb83c84de238927724ce8e29efcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Zaefferer?= Date: Fri, 9 Nov 2012 17:42:11 +0100 Subject: [PATCH] Dialog: Use $.isEmptyObject() to check if there a button-option properties --- ui/jquery.ui.dialog.js | 11 ++--------- 1 file 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 ) ?