mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user