From 8135f694389de25a4d02b5efb3fa5f785bc13793 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Mon, 10 Jun 2013 21:07:19 +0600 Subject: [PATCH] [#135] fix expire date of the flash notify message --- app/assets/javascripts/extra/flash_notifies.js | 5 ++++- app/views/layouts/_notifies.html.haml | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/extra/flash_notifies.js b/app/assets/javascripts/extra/flash_notifies.js index 52c9fbf53..e9e2522a5 100644 --- a/app/assets/javascripts/extra/flash_notifies.js +++ b/app/assets/javascripts/extra/flash_notifies.js @@ -12,7 +12,10 @@ $(document).ready(function() { } $('#close-alert').click(function () { - setCookie("flash_notify_hash", FLASH_HASH_ID, FLASH_EXPIRES_AT); + var exdate=new Date(); + exdate.setDate(exdate.getDate() + 365); + var expires="expires="+exdate.toUTCString(); + setCookie("flash_notify_hash", FLASH_HASH_ID, expires); }); }); diff --git a/app/views/layouts/_notifies.html.haml b/app/views/layouts/_notifies.html.haml index fa5accc99..1c1f9c98f 100644 --- a/app/views/layouts/_notifies.html.haml +++ b/app/views/layouts/_notifies.html.haml @@ -7,4 +7,3 @@ :javascript var FLASH_HASH_ID = "#{flash_notify.hash_id}"; - var FLASH_EXPIRES_AT = "#{Date.today + 1.year}";