From eac750912f80b7d18589f85ab9e4a4c49ffb65d6 Mon Sep 17 00:00:00 2001 From: Alexander Zaytsev Date: Mon, 9 Mar 2026 09:55:23 +0100 Subject: [PATCH] Reset checkbox when cancellation dialog closes --- .../controllers/toggle_enable_controller.js | 11 ++++++++++- app/views/account/settings/_cancellation.html.erb | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/javascript/controllers/toggle_enable_controller.js b/app/javascript/controllers/toggle_enable_controller.js index b65ea57d4..78496cd7d 100644 --- a/app/javascript/controllers/toggle_enable_controller.js +++ b/app/javascript/controllers/toggle_enable_controller.js @@ -1,11 +1,20 @@ import { Controller } from "@hotwired/stimulus" export default class extends Controller { - static targets = [ "element" ] + static targets = [ "element", "checkbox" ] toggle() { this.elementTargets.forEach((element) => { element.toggleAttribute("disabled") }) } + + reset() { + this.checkboxTargets.forEach((checkbox) => { + checkbox.checked = false + }) + this.elementTargets.forEach((element) => { + element.toggleAttribute("disabled", true) + }) + } } diff --git a/app/views/account/settings/_cancellation.html.erb b/app/views/account/settings/_cancellation.html.erb index 193316ced..6411c6833 100644 --- a/app/views/account/settings/_cancellation.html.erb +++ b/app/views/account/settings/_cancellation.html.erb @@ -5,10 +5,10 @@
Permanently delete this account and all its data, including users, boards, and cards.
-
+
- +

Delete account

What happens next:

@@ -29,9 +29,9 @@

-
+