Enable restitution of morphed messages
This commit is contained in:
parent
c91d8698bd
commit
f3d0968da1
2 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
#flash_messages
|
||||
#flash_message.center
|
||||
#flash_messages{ tabindex: '-1' }
|
||||
#flash_message.center{ class: defined?(unique_classname) ? unique_classname : '' }
|
||||
- if flash.any?
|
||||
- flash.each do |key, value|
|
||||
- sticky = defined?(sticky) ? sticky : false
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
- if flash.any?
|
||||
= turbo_stream.replace 'flash_messages', partial: 'layouts/flash_messages'
|
||||
- unique_classname= "u#{SecureRandom.hex}"
|
||||
= turbo_stream.replace 'flash_messages', partial: 'layouts/flash_messages', locals: { unique_classname: }
|
||||
= turbo_stream.focus 'flash_messages'
|
||||
= turbo_stream.show 'flash_messages'
|
||||
= turbo_stream.hide 'flash_messages', delay: 30000
|
||||
= turbo_stream.hide_all ".#{unique_classname}", delay: 15000
|
||||
- flash.clear
|
||||
|
||||
= yield
|
||||
|
|
Loading…
Reference in a new issue