Compare commits

...

1 commit

Author SHA1 Message Date
Christophe Robillard
8f9ef3c9f8 only click to view mood day, no mouse over
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run
2026-02-26 10:02:48 +01:00
2 changed files with 1 additions and 7 deletions

View file

@ -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";
}

View file

@ -49,7 +49,7 @@
<div class="is-flex is-flex-direction-column is-flex-wrap-wrap mb-3">
<% week.each do |mood| %>
<% mode = mode_for(mood) %>
<div data-image="<%= asset_path(mode + ".jpg") %>" 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 %>"></div>
<div data-image="<%= asset_path(mode + ".jpg") %>" data-mode="<%= mode %>" data-day="<%= l mood[:recorded_at].to_date %>" data-action="click->mood#updateDayInfo" title="<%= mood[:recorded_at] %> : <%= mode %>" class="day <%= mode %>"></div>
<% end %>
</div>
<% end %>