Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only clear a_b_s cookie when the request is complete

  • Loading branch information...
commit 971e3f2e758ea19e8fb31a60eb5af4fed739723d 1 parent c6e859f
@winton authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 public/js/a_b.js
View
10 public/js/a_b.js
@@ -3,6 +3,7 @@ window.A_B = new function() {
// Global variables
var categories, env, url;
+ var allow_requests = true;
// Classes
@@ -26,8 +27,8 @@ window.A_B = new function() {
clearTimeout(timer);
timer = setTimeout(function() {
var json = Cookies.get('a_b_s');
- if (json) {
- Cookies.set('a_b_s', null);
+ if (json && allow_requests) {
+ allow_requests = false;
var src = [
url, '/a_b.js?',
'e=', encodeURIComponent(env), '&',
@@ -380,6 +381,11 @@ window.A_B = new function() {
return Test(c, t, e);
};
+ window.a_b_finished = function() {
+ Cookies.set('a_b_s', null);
+ allow_requests = true;
+ };
+
window.a_b_setup = function(options) {
categories = options.categories;
env = options.env;
Please sign in to comment.
Something went wrong with that request. Please try again.