diff options
Diffstat (limited to 'static/index.js')
| -rw-r--r-- | static/index.js | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/static/index.js b/static/index.js index c6388eb..a7211e2 100644 --- a/static/index.js +++ b/static/index.js @@ -33,12 +33,7 @@ const image_viewer = ImageViewer.new(); const login = LoginView.new({ onlogin: async (user, password) => { if (await api.auth.login(user, password)) { - document.body.innerHTML = ''; - document.body.append( - main, - search, - month_select, - ) + login.hide(); } else { login.comment = 'Incorrect username or password.'; } @@ -63,8 +58,7 @@ const month_select = MonthSelect.new({ const settings = SettingsView.new({ onlogout: () => { - document.body.innerHTML = ''; - document.body.append(login) + login.show(); main.active_view = image_viewer; }, }); @@ -101,4 +95,11 @@ const main = MainView.new({ }, }); -document.body.append(login); +document.body.append( + login, + main, + search, + month_select, +); + +login.focus(); |