]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Fix yoda-if, remove unnecessary TODOs; add missing callbacks to commons test
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 9 Nov 2012 16:17:32 +0000 (17:17 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Fri, 16 Nov 2012 09:27:43 +0000 (10:27 +0100)
tests/unit/dialog/dialog_common.js
ui/jquery.ui.dialog.js

index 2c0e86b46c58f3c22c350bd99636da58dfad70f6..fb29838b70608a4fa30bd5d4c791a18e3baeecb3 100644 (file)
@@ -27,6 +27,16 @@ TestHelpers.commonWidgetTests( "dialog", {
                width: 300,
 
                // callbacks
-               create: null
+               beforeClose: null,
+               close: null,
+               create: null,
+               drag: null,
+               dragStart: null,
+               dragStop: null,
+               focus: null,
+               open: null,
+               resize: null,
+               resizeStart: null,
+               resizeStop: null
        }
 });
index 7545a8adf4debed292c57d2af662d5ba7c928b34..04b23f2a1d44bf54929926c0107d849fc56c8e0c 100644 (file)
@@ -94,7 +94,6 @@ $.widget("ui.dialog", {
                        parent: this.element.parent(),
                        index: this.element.parent().children().index( this.element )
                };
-               // TODO don't overwrite options
                this.options.title = this.options.title || this.originalTitle;
                var that = this,
                        options = this.options,
@@ -276,8 +275,7 @@ $.widget("ui.dialog", {
                        return;
                }
 
-               // TODO fix yoda-if
-               if ( false === this._trigger( "beforeClose", event ) ) {
+               if ( this._trigger( "beforeClose", event ) === false ) {
                        return;
                }
 
@@ -294,7 +292,6 @@ $.widget("ui.dialog", {
                        $( this.document[ 0 ].activeElement ).blur();
                }
 
-               // TODO shouldn't _hide restore `this` to the instance? would also help tooltip
                this._hide( this.uiDialog, this.options.hide, function() {
                        that._trigger( "close", event );
                });