From 977ea97d653bf06248e06b78c65d9bdf1dd63a37 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 | 8 +------- app/views/moods/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/javascript/controllers/mood_controller.js b/app/javascript/controllers/mood_controller.js index b6a373f..71b18c3 100644 --- a/app/javascript/controllers/mood_controller.js +++ b/app/javascript/controllers/mood_controller.js @@ -1,23 +1,17 @@ import { Controller } from '@hotwired/stimulus' export default class extends Controller { - static targets = [ "image", "modeDay", "modeDayMobile" ] + static targets = [ "image", "modeDay" ]; 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 %>