only click to view mood day, no mouse over
This commit is contained in:
parent
eecc0105c1
commit
8f9ef3c9f8
2 changed files with 1 additions and 7 deletions
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue