diff --git a/public/js/app.js b/public/js/app.js index 299bbe0..e39c720 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -82,10 +82,11 @@ const App = { showPublic(page, param) { document.getElementById('top-bar').classList.remove('hidden'); - document.getElementById('top-auth').classList.remove('hidden'); document.getElementById('main-layout').classList.add('hidden'); const pub = document.getElementById('public-page'); pub.classList.remove('hidden'); + const topAuth = document.getElementById('top-auth'); + if (Auth.logged()) { topAuth.classList.add('hidden'); } else { topAuth.classList.remove('hidden'); } const comp = page === 'login' ? LoginPage : page === 'register' ? RegisterPage : page === 'install' ? InstallPage : HomePage; comp.render(param).then(html => { pub.innerHTML = html; if (comp.mount) comp.mount(param); }).catch(() => { pub.innerHTML = '
'; @@ -118,3 +119,22 @@ const App = { }; document.addEventListener('DOMContentLoaded', () => App.init()); +window.App = App; +window.Dashboard = Dashboard; +window.TicketsPage = TicketsPage; +window.TicketDetail = TicketDetail; +window.TicketCreate = TicketCreate; +window.TrackingPage = TrackingPage; +window.UnclaimedPage = UnclaimedPage; +window.UsersPage = UsersPage; +window.TemplatesPage = TemplatesPage; +window.NotificationsPage = NotificationsPage; +window.SettingsPage = SettingsPage; +window.ExportPage = ExportPage; +window.LoginPage = LoginPage; +window.RegisterPage = RegisterPage; +window.HomePage = HomePage; +window.InstallPage = InstallPage; +window.U = U; +window.Auth = Auth; +window.API = API;