From f6d605a3aa12c4cfbd75975a741f20a49e771a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <2887858+deivid-rodriguez@users.noreply.github.com> Date: Tue, 4 Nov 2025 13:17:36 +0100 Subject: [PATCH] Dismiss success message automatically after 5 seconds We were already eventually removing the "success" border style on inputs. I think it makes sense to do the same for the success message itself. That's how our standard "flash messages" already work. --- .../admin/index_utils/services/switch_class.js.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/admin/index_utils/services/switch_class.js.coffee b/app/assets/javascripts/admin/index_utils/services/switch_class.js.coffee index a8e8a584b2..46eb0dc298 100644 --- a/app/assets/javascripts/admin/index_utils/services/switch_class.js.coffee +++ b/app/assets/javascripts/admin/index_utils/services/switch_class.js.coffee @@ -1,4 +1,4 @@ -angular.module("admin.indexUtils").factory "switchClass", ($timeout) -> +angular.module("admin.indexUtils").factory "switchClass", ($timeout, StatusMessage) -> return (element, classToAdd, removeClasses, timeout) -> $timeout.cancel element.timeout if element.timeout element.removeClass className for className in removeClasses @@ -7,5 +7,6 @@ angular.module("admin.indexUtils").factory "switchClass", ($timeout) -> if timeout && intRegex.test(timeout) element.timeout = $timeout(-> element.removeClass classToAdd + StatusMessage.clear() , timeout, true) element