Skip to content

Commit

Permalink
issue #27: now configurable!
Browse files Browse the repository at this point in the history
  • Loading branch information
chieffancypants committed Dec 12, 2013
1 parent 87aae00 commit ba17938
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/loading-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ angular.module('chieffancypants.loadingBar', [])
*/
var reqsCompleted = 0;

/**
* The amount of time spent fetching before showing the loading bar
*/
var latencyThreshold = cfpLoadingBar.latencyThreshold || 100;

/**
* calls cfpLoadingBar.complete() which removes the
Expand Down Expand Up @@ -92,7 +96,7 @@ angular.module('chieffancypants.loadingBar', [])
if (reqsTotal === 0) {
startTimeout = $timeout(function() {
cfpLoadingBar.start();
}, 100);
}, latencyThreshold);
}
reqsTotal++;
}
Expand Down

0 comments on commit ba17938

Please sign in to comment.