From a36dd58a8c1915fe40dc36a7388998953def69bf Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Wed, 13 Jan 2016 12:32:45 -0500 Subject: [PATCH] set subcat cookie to expire immediately --- js/app.js | 11 +++++++---- js/custom/upcp.js | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/js/app.js b/js/app.js index bed6aae..98ff46f 100644 --- a/js/app.js +++ b/js/app.js @@ -24,13 +24,16 @@ $(document).ready(function () { function createCookie(name, value) { var date = new Date(); - if(name === "subcat"){ - date.setTime(date.getTime()+(1*1000)); - } date.setTime(date.getTime()+(3*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = name+"="+value+expires+"; path=/"; } + function createCookieSubcat(name, value) { + var date = new Date(); + date.setTime(date.getTime()+(1*1000)); + var expires = "; expires="+date.toGMTString(); + document.cookie = name+"="+value+expires+"; path=/"; + } // createCookie("link", "null"); document.cookie = "catView=grid"; @@ -208,7 +211,7 @@ $(document).ready(function () { }); $(".catContainer").on("click", function() { - createCookie("subcat", "subcat"); + createCookieSubcat("subcat", "subcat"); }); // $(".subcat").on("click", function() { diff --git a/js/custom/upcp.js b/js/custom/upcp.js index 5c63255..1725a88 100644 --- a/js/custom/upcp.js +++ b/js/custom/upcp.js @@ -4,13 +4,16 @@ $(document).ready(function () { function createCookie(name, value) { var date = new Date(); - if(name === "subcat"){ - date.setTime(date.getTime()+(1*1000)); - } date.setTime(date.getTime()+(3*1000)); var expires = "; expires="+date.toGMTString(); document.cookie = name+"="+value+expires+"; path=/"; } + function createCookieSubcat(name, value) { + var date = new Date(); + date.setTime(date.getTime()+(1*1000)); + var expires = "; expires="+date.toGMTString(); + document.cookie = name+"="+value+expires+"; path=/"; + } // createCookie("link", "null"); document.cookie = "catView=grid"; @@ -188,7 +191,7 @@ $(document).ready(function () { }); $(".catContainer").on("click", function() { - createCookie("subcat", "subcat"); + createCookieSubcat("subcat", "subcat"); }); // $(".subcat").on("click", function() { -- 2.17.1