Namespace bubble-related targets
This commit is contained in:
@@ -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 = [ "top", "days", "bottom" ]
|
||||
static targets = [ "bubbleTop", "bubbleDays", "bubbleBottom" ]
|
||||
static values = { entropy: Object }
|
||||
|
||||
#timer
|
||||
@@ -26,9 +26,9 @@ export default class extends Controller {
|
||||
return
|
||||
}
|
||||
|
||||
this.topTarget.innerHTML = closesInDays < 1 ? this.entropyValue.action : `${this.entropyValue.action} in`
|
||||
this.daysTarget.innerHTML = closesInDays < 1 ? "!" : closesInDays
|
||||
this.bottomTarget.innerHTML = closesInDays < 1 ? "Today" : (closesInDays === 1 ? "day" : "days")
|
||||
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.#show()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user