Skip to content

Commit

Permalink
Don't assign an idle state to widgets if there's a redirect coming up
Browse files Browse the repository at this point in the history
  • Loading branch information
Inviz committed Apr 12, 2012
1 parent b654206 commit 9858641
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Mixin/Request.js
Expand Up @@ -80,10 +80,13 @@ LSD.Mixin.Request = new Class({
var request = this[type == 'xhr' ? 'getXHRRequest' : 'getFormRequest'](options);
request.addEvents({
request: function() {
clearTimeout(this.idling);
this.busy()
}.bind(this),
complete: function() {
this.idle();
clearTimeout(this.idling);
if (this.isRequestFinished()) this.idle();
else this.idling = this.idle.delay(7500, this);
if (request.isSuccess && request.isSuccess() && this.getCommandAction && this.getCommandAction() == 'submit')
if (this.chainPhase == -1
|| (this.chainPhase == this.getActionChain().length - 1)
Expand All @@ -93,6 +96,10 @@ LSD.Mixin.Request = new Class({
});
return request;
},

isRequestFinished: function() {
return !this.request.getHeader('X-Redirect');
},

getXHRRequest: function(options) {
return new Request.Auto(options);
Expand Down

0 comments on commit 9858641

Please sign in to comment.