]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Use $.isEmptyObject() to check if there a button-option properties
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 9 Nov 2012 16:42:11 +0000 (17:42 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 26 Nov 2012 09:26:12 +0000 (10:26 +0100)
ui/jquery.ui.dialog.js

index 628139407492eb05ebc5c07cf764f8b4d2008dbf..f536120d572e6dc45e68ba56adf73adad20771bb 100644 (file)
@@ -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 ) ?