mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Widget: return timer value from _delay
This commit is contained in:
parent
30482cd04b
commit
3a0340f4ee
@ -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 );
|
||||
|
2
ui/jquery.ui.widget.js
vendored
2
ui/jquery.ui.widget.js
vendored
@ -339,7 +339,7 @@ $.Widget.prototype = {
|
||||
.apply( instance, arguments );
|
||||
}
|
||||
var instance = this;
|
||||
setTimeout( handlerProxy, delay || 0 );
|
||||
return setTimeout( handlerProxy, delay || 0 );
|
||||
},
|
||||
|
||||
_hoverable: function( element ) {
|
||||
|
Loading…
Reference in New Issue
Block a user