add topbar.js on form submit and page navigate

This commit is contained in:
shibao 2023-01-25 20:31:36 -05:00 committed by oliviasculley
parent 1cd28e43b8
commit 469428c007
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,8 @@ Alpine.start()
topbar.config({ barColors: { 0: '#29d' }, shadowColor: 'rgba(0, 0, 0, .3)' })
window.addEventListener('phx:page-loading-start', info => topbar.show())
window.addEventListener('phx:page-loading-stop', info => topbar.hide())
window.addEventListener('submit', info => topbar.show())
window.addEventListener('beforeunload', info => topbar.show())
// connect if there are any LiveViews on the page
liveSocket.connect()