cho45 / jsdeferred

Asynchronous library in JavaScript. Standalone and Compact.
http://cho45.stfuawsc.com/jsdeferred/
332 stars 48 forks source link

Wrong process sequence with using Deferred.connect #4

Closed cho45 closed 14 years ago

cho45 commented 14 years ago
// --------------- Here order of log is 2 -> 1 , child redirect works wrong

function showData(data) {
    var fadeout = Deferred.connect($.fn.fadeOut, { target: $('#container'), ok:1 });
    return fadeout(500).
    next(function() {
        return $('#container')
            .text(data)
            .deferred("fadeIn", 2000)
            .next(function() { console.log(1) })
    }).
    next(function() { console.log(2) })
}
cho45 commented 14 years ago

Fixed: http://github.com/cho45/jsdeferred/commit/d1e3320e6015fab1c76de06469d3373c55d5321e