From 8f9ef3c9f87e47e9d9a69ee854e3d373674a11df Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Thu, 26 Feb 2026 10:02:48 +0100 Subject: [PATCH] only click to view mood day, no mouse over --- app/javascript/controllers/mood_controller.js | 6 ------ app/views/moods/index.html.erb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/javascript/controllers/mood_controller.js b/app/javascript/controllers/mood_controller.js index b6a373f..5473d66 100644 --- a/app/javascript/controllers/mood_controller.js +++ b/app/javascript/controllers/mood_controller.js @@ -6,18 +6,12 @@ export default class extends Controller { updateDayInfo(event) { const image = this.imageTarget; const modeDay = this.modeDayTarget; - const modeDayMobile = this.modeDayMobileTarget; const modeDayContent = event.target.dataset.day + ' : ' + event.target.dataset.mode; image.src = event.target.dataset.image; - modeDayMobile.textContent = modeDayContent; modeDay.textContent = modeDayContent; event.target.className = "selected-day " + event.target.dataset.mode; } - removeFeedback(event) { - event.target.className = "day " + event.target.dataset.mode; - } - connect() { window.location = "#end"; } diff --git a/app/views/moods/index.html.erb b/app/views/moods/index.html.erb index 4249d96..ac16709 100644 --- a/app/views/moods/index.html.erb +++ b/app/views/moods/index.html.erb @@ -49,7 +49,7 @@
<% week.each do |mood| %> <% mode = mode_for(mood) %> -
" data-mode="<%= mode %>" data-day="<%= l mood[:recorded_at].to_date %>" data-action="click->mood#updateDayInfo mouseover->mood#updateDayInfo mouseleave->mood#removeFeedback" title="<%= mood[:recorded_at] %> : <%= mode %>" class="day <%= mode %>">
+
" data-mode="<%= mode %>" data-day="<%= l mood[:recorded_at].to_date %>" data-action="click->mood#updateDayInfo" title="<%= mood[:recorded_at] %> : <%= mode %>" class="day <%= mode %>">
<% end %>
<% end %>