mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Darkswarm flash loader works with :notice flash messages
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
Darkswarm.factory 'RailsFlashLoader', (flash, railsFlash)->
|
||||
new class RailsFlashLoader
|
||||
# The 'flash' service requires type key to
|
||||
# be one of: success, info, warn, error
|
||||
typePairings:
|
||||
success: 'success'
|
||||
error: 'error'
|
||||
notice: 'success'
|
||||
info: 'info'
|
||||
warn: 'warn'
|
||||
|
||||
initFlash: ->
|
||||
@loadFlash railsFlash
|
||||
|
||||
loadFlash: (rails_flash)->
|
||||
for type, message of rails_flash
|
||||
type = @typePairings[type]
|
||||
flash[type] = message
|
||||
|
||||
Reference in New Issue
Block a user