From: Jörn Zaefferer Date: Fri, 9 Nov 2012 16:42:11 +0000 (+0100) Subject: Dialog: Use $.isEmptyObject() to check if there a button-option properties X-Git-Tag: 1.10.0-beta.1~124 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=324d54dd3283bb83c84de238927724ce8e29efcc;p=jquery-ui.git Dialog: Use $.isEmptyObject() to check if there a button-option properties --- 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 ) ?