diff --git a/lib/sammy.js b/lib/sammy.js index b59cad28..4afcbb59 100644 --- a/lib/sammy.js +++ b/lib/sammy.js @@ -1551,9 +1551,11 @@ $.extend(Sammy.DefaultLocationProxy.prototype , { } var context = this; if (this.waiting) { - this.callbacks.push(callback); + this.callbacks.splice(this.inAThen,0,callback); + this.inAThen++; } else { this.wait(); + this.inAThen = 0; window.setTimeout(function() { var returned = callback.apply(context, [context.content, context.previous_content]); if (returned !== false) {