From effb96537a1d6cc19ffae132f48f34fd9739e8cc Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 4 Dec 2025 22:16:00 +0100 Subject: [PATCH] Use buil-in support for :self in Stimulus Thanks to @brunoprietog for advice https://github.com/basecamp/fizzy/pull/1927/files/9639e07ab88f628f5f37ad2aa9acee2b86d4fb1a#diff-24a46f2ca97f2964d4d8940123b7f76578694567df84256f576aa4bee221179e --- app/javascript/controllers/bubble_controller.js | 6 ------ app/views/cards/display/preview/_bubble.html.erb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/javascript/controllers/bubble_controller.js b/app/javascript/controllers/bubble_controller.js index ec66a417a..714977c66 100644 --- a/app/javascript/controllers/bubble_controller.js +++ b/app/javascript/controllers/bubble_controller.js @@ -28,12 +28,6 @@ export default class extends Controller { } } - morphed({target}) { - if (this.element === target) { - this.update() - } - } - get #hasEntropy() { return this.#entropyCleanupInDays < this.entropyValue.daysBeforeReminder } diff --git a/app/views/cards/display/preview/_bubble.html.erb b/app/views/cards/display/preview/_bubble.html.erb index c088ea608..40d8e4311 100644 --- a/app/views/cards/display/preview/_bubble.html.erb +++ b/app/views/cards/display/preview/_bubble.html.erb @@ -4,7 +4,7 @@ class: "bubble", data: { controller: "bubble", - action: "turbo:morph-element->bubble#morphed", + action: "turbo:morph-element->bubble#update:self", bubble_entropy_value: entropy_bubble_options_for(card).to_json, bubble_stalled_value: stalled_bubble_options_for(card)&.to_json } do %>