diff --git a/app/javascript/controllers/bubble_controller.js b/app/javascript/controllers/bubble_controller.js index 714977c66..ec66a417a 100644 --- a/app/javascript/controllers/bubble_controller.js +++ b/app/javascript/controllers/bubble_controller.js @@ -28,6 +28,12 @@ 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 c39772090..c088ea608 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#update", + action: "turbo:morph-element->bubble#morphed", bubble_entropy_value: entropy_bubble_options_for(card).to_json, bubble_stalled_value: stalled_bubble_options_for(card)&.to_json } do %>