Skip to content

Commit 3a0340f

Browse files
committed
Widget: return timer value from _delay
1 parent 30482cd commit 3a0340f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tests/unit/widget/widget_core.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,19 +1041,21 @@ test( "redefine", function() {
10411041
});
10421042

10431043
asyncTest( "_delay", function() {
1044-
expect( 4 );
1044+
expect( 6 );
10451045
var order = 0,
10461046
that;
10471047
$.widget( "ui.testWidget", {
10481048
defaultElement: null,
10491049
_create: function() {
10501050
that = this;
1051-
this._delay(function() {
1051+
var timer = this._delay(function() {
10521052
strictEqual( this, that );
10531053
equal( order, 1 );
10541054
start();
10551055
}, 500);
1056-
this._delay("callback");
1056+
ok( timer !== undefined );
1057+
timer = this._delay("callback");
1058+
ok( timer !== undefined );
10571059
},
10581060
callback: function() {
10591061
strictEqual( this, that );

ui/jquery.ui.widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ $.Widget.prototype = {
339339
.apply( instance, arguments );
340340
}
341341
var instance = this;
342-
setTimeout( handlerProxy, delay || 0 );
342+
return setTimeout( handlerProxy, delay || 0 );
343343
},
344344

345345
_hoverable: function( element ) {

0 commit comments

Comments
 (0)