From 007067576c7021a18ba48dfa4f52944a17ccee45 Mon Sep 17 00:00:00 2001 From: "Ivan.Nginx" Date: Sat, 8 Apr 2017 07:47:42 +0300 Subject: [PATCH] FIX: `save_scroll` main script file. [4] --- source/js/src/scroll-cookie.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/js/src/scroll-cookie.js b/source/js/src/scroll-cookie.js index 56aedc8f3..34ff200bd 100644 --- a/source/js/src/scroll-cookie.js +++ b/source/js/src/scroll-cookie.js @@ -1,7 +1,6 @@ $(document).ready(function() { // Set relative link path (without domain) - // https://stackoverflow.com/questions/3955959/whats-an-easy-way-to-get-the-url-in-the-current-window-minus-the-domain-name var rpath = window.location.href.replace(window.location.origin, ""); // Write position in cookie @@ -9,7 +8,7 @@ $(document).ready(function() { $(window).on("scroll", function() { clearTimeout(timeout); timeout = setTimeout(function () { - Cookies.set("scroll-cookie", ($(window).scrollTop() + "|" + rpath), { path: '' }); + Cookies.set("scroll-cookie", ($(window).scrollTop() + "|" + rpath), { expires: 365, path: '' }); }, 250); });