From 76119b17bdde15058b3526d600f195c16f6642d2 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 5 Jun 2025 10:33:02 +0200 Subject: [PATCH] Entropy, not bubble! --- app/javascript/controllers/bubble_controller.js | 8 ++++---- app/views/cards/display/preview/_bubble.html.erb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/javascript/controllers/bubble_controller.js b/app/javascript/controllers/bubble_controller.js index 53ef43bea..8968aaa26 100644 --- a/app/javascript/controllers/bubble_controller.js +++ b/app/javascript/controllers/bubble_controller.js @@ -4,7 +4,7 @@ import { signedDifferenceInDays } from "helpers/date_helpers" const REFRESH_INTERVAL = 3_600_000 // 1 hour (in milliseconds) export default class extends Controller { - static targets = [ "bubbleTop", "bubbleDays", "bubbleBottom" ] + static targets = [ "entropy", "entropyTop", "entropyDays", "entropyBottom" ] static values = { entropy: Object } #timer @@ -26,9 +26,9 @@ export default class extends Controller { return } - this.bubbleTopTarget.innerHTML = closesInDays < 1 ? this.entropyValue.action : `${this.entropyValue.action} in` - this.bubbleDaysTarget.innerHTML = closesInDays < 1 ? "!" : closesInDays - this.bubbleBottomTarget.innerHTML = closesInDays < 1 ? "Today" : (closesInDays === 1 ? "day" : "days") + this.entropyTopTarget.innerHTML = closesInDays < 1 ? this.entropyValue.action : `${this.entropyValue.action} in` + this.entropyDaysTarget.innerHTML = closesInDays < 1 ? "!" : closesInDays + this.entropyBottomTarget.innerHTML = closesInDays < 1 ? "Today" : (closesInDays === 1 ? "day" : "days") this.#show() } diff --git a/app/views/cards/display/preview/_bubble.html.erb b/app/views/cards/display/preview/_bubble.html.erb index 8c2bad595..d3d440157 100644 --- a/app/views/cards/display/preview/_bubble.html.erb +++ b/app/views/cards/display/preview/_bubble.html.erb @@ -9,17 +9,17 @@ - + - + - +