From 592c016c84d57bfab1def0df4ef692903f79f33c Mon Sep 17 00:00:00 2001 From: Serge Bredin Date: Tue, 19 Jan 2016 18:19:07 +0100 Subject: [PATCH] fix issue with favorite on Firefox + now date on avatars --- client/js/favorite.js | 4 ++-- client/views/placeView.jsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/js/favorite.js b/client/js/favorite.js index 2dc959a..f98ae03 100644 --- a/client/js/favorite.js +++ b/client/js/favorite.js @@ -17,10 +17,10 @@ function getCookie(sName) { function changeFavorite(e){ - var button = e.srcElement.parentNode; + var button = e.currentTarget; var isFavorite = button.class === 'place-favorite'; button.class = isFavorite ? 'place-no-favorite' : 'place-favorite'; - e.srcElement.src = isFavorite ? '../img/no-favorite.svg' : '../img/favorite.svg'; + e.currentTarget.firstChild.src = isFavorite ? '../img/no-favorite.svg' : '../img/favorite.svg'; var id = button.id.replace('register-',''); var cookie_places = getCookie('6element-places') || ''; if(isFavorite) setCookie('6element-places', cookie_places.replace(id + ';',''));// remove place in cookie diff --git a/client/views/placeView.jsx b/client/views/placeView.jsx index 269f767..50e5fb4 100644 --- a/client/views/placeView.jsx +++ b/client/views/placeView.jsx @@ -40,7 +40,9 @@ module.exports = React.createClass({ // OPENING HOURS var oh = place.opening_hours === null ? undefined : new opening_hours(place.opening_hours); - var now = fromUTC(momentTZ().tz('Europe/Paris').format()); + var now = new Date(momentTZ().tz('Europe/Paris').format()); + //console.log(now); + //var now = fromUTC(momentTZ().tz('Europe/Paris').format()); var isOpen = oh ? oh.getState(now) : true; var calendarJSX = NotEmpty(place.opening_hours) ?