]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: return timer value from _delay
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 12 Sep 2011 21:47:09 +0000 (23:47 +0200)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 12 Sep 2011 21:47:09 +0000 (23:47 +0200)
tests/unit/widget/widget_core.js
ui/jquery.ui.widget.js

index 0b272a0d50516d512ab53c3241af89438ad73202..0510da4b4cc84dd2770a67d3f71ae43b95286a6a 100644 (file)
@@ -1041,19 +1041,21 @@ test( "redefine", function() {
 });
 
 asyncTest( "_delay", function() {
-       expect( 4 );
+       expect( 6 );
        var order = 0,
                that;
        $.widget( "ui.testWidget", {
                defaultElement: null,
                _create: function() {
                        that = this;
-                       this._delay(function() {
+                       var timer = this._delay(function() {
                                strictEqual( this, that );
                                equal( order, 1 );
                                start();
                        }, 500);
-                       this._delay("callback");
+                       ok( timer !== undefined );
+                       timer = this._delay("callback");
+                       ok( timer !== undefined );
                },
                callback: function() {
                        strictEqual( this, that );
index 55b6eda5d365fdddb3f1a501343e317a1d3be2aa..31328a45564383cb35133d39b56f2d855b8ef17b 100644 (file)
@@ -339,7 +339,7 @@ $.Widget.prototype = {
                                .apply( instance, arguments );
                }
                var instance = this;
-               setTimeout( handlerProxy, delay || 0 );
+               return setTimeout( handlerProxy, delay || 0 );
        },
 
        _hoverable: function( element ) {