Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/davis.request.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
*/

Davis.Request = (function () {
/*!
* keep track of the first page load that Davis handles, this will be used to determine
* request.isForPageLoad
* @private
*/
var isFirstPageLoad = true;

/**
* Davis.Requests are created from click and submit events. Davis.Requests are passed to Davis.Routes
Expand Down Expand Up @@ -107,8 +113,15 @@ Davis.Request = (function () {
this.fullPath = raw.fullPath;

this.delegateToServer = raw.delegateToServer || Davis.noop;
this.isForPageLoad = raw.forPageLoad || false;

if (isFirstPageLoad) {
isFirstPageLoad = false;
this.isForPageLoad = true;
} else {
this.isForPageLoad = false;
}
// this.isForPageLoad = raw.forPageLoad || false;

if (Request.prev) Request.prev.makeStale(this);
Request.prev = this;

Expand Down