Widget: return timer value from _delay

This commit is contained in:
Jörn Zaefferer 2011-09-12 23:47:09 +02:00
parent 30482cd04b
commit 3a0340f4ee
2 changed files with 6 additions and 4 deletions

View 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 );

View 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 ) {