From 2a9f0681dee3a6421bafd2fbc4451c9fe364b6ca Mon Sep 17 00:00:00 2001 From: jaubourg Date: Wed, 9 Nov 2011 01:02:29 +0100 Subject: Have Deferred.always return the object onto which it is currently attached to enable true chainability. Fixes #10723. Unit tests added. --- src/deferred.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/deferred.js') diff --git a/src/deferred.js b/src/deferred.js index 9444f895f..c97084b70 100644 --- a/src/deferred.js +++ b/src/deferred.js @@ -33,7 +33,8 @@ jQuery.extend({ return this; }, always: function() { - return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); + return this; }, pipe: function( fnDone, fnFail, fnProgress ) { return jQuery.Deferred(function( newDefer ) { -- cgit v1.2.3