enter on login + animate in snaptobus

This commit is contained in:
STEINNI
2025-09-22 19:49:33 +00:00
parent 1641f5b07e
commit 7c6047462f
4 changed files with 30 additions and 133 deletions
+17 -10
View File
@@ -93,16 +93,7 @@ class myUser extends app.LoadedClasses.User {
const startbtn = document.querySelector('#startbtn')
const gobtn = document.querySelector('#login-dialog button')
gobtn.addEventListener('click', async () => {
gobtn.disabled = true
if(await this.login()) {
document.querySelector('div.loginerr').classList.remove('show')
console.log('Successful login !!!')
callBack()
} else {
gobtn.disabled = false
}
})
gobtn.addEventListener('click', () => this.launchLogin(callBack))
startbtn.addEventListener('click', async () => {
startbtn.disabled = true
@@ -116,6 +107,9 @@ class myUser extends app.LoadedClasses.User {
} else if(!jsonresp.payload.authenticated){
document.querySelector('div.loginerr').classList.remove('show')
document.getElementById('login-dialog').classList.add('show')
document.getElementById('login-dialog').addEventListener('keyup',(event)=>{
if(event.key=='Enter') this.launchLogin(callBack)
})
if(jsonresp.payload.locked){
document.querySelector('div.loginerr').classList.add('show')
document.querySelector('div.loginerr').innerHTML = `
@@ -134,6 +128,19 @@ class myUser extends app.LoadedClasses.User {
})
}
async launchLogin(callBack){
const gobtn = document.querySelector('#login-dialog button')
gobtn.disabled = true
if(await this.login()) {
document.querySelector('div.loginerr').classList.remove('show')
console.log('Successful login !!!')
callBack()
} else {
gobtn.disabled = false
}
}
/**
*
* @returns {string}