mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-22 07:08:11 +00:00
register button transfers infor from login section
This commit is contained in:
parent
104b54d820
commit
3c493b0524
@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div id="loginPopupContentBodyBtns">
|
||||
<button class="playBtn" id="loginPopupContentBodyBtnLogin" onclick="login()">Login</button>
|
||||
<button class="altBtn" id="loginPopupContentBodyBtnRegister" onclick="register()">Register</button>
|
||||
<button class="altBtn" id="loginPopupContentBodyBtnRegister" onclick="setRegisterSection(true)">Register</button>
|
||||
</div>
|
||||
<div>
|
||||
<button class="altBtn" id="noLoginBtn" onclick="(() => { launchPrivate(); closeLogin()})()">
|
||||
|
@ -17,7 +17,7 @@ async function setLoginSection() {
|
||||
/**
|
||||
* Toggle the register section
|
||||
*/
|
||||
async function setRegisterSection() {
|
||||
async function setRegisterSection(fromLogin = false) {
|
||||
const title = document.getElementById('registerSectionTitle');
|
||||
const altTitle = document.getElementById('loginSectionTitle');
|
||||
const loginSection = document.getElementById('loginPopupContentBody');
|
||||
@ -28,6 +28,15 @@ async function setRegisterSection() {
|
||||
|
||||
loginSection.style.display = 'none';
|
||||
registerSection.style.removeProperty('display');
|
||||
|
||||
if (fromLogin) {
|
||||
// Take the values from the login section and put them in the register section
|
||||
const loginUsername = document.getElementById('loginUsername').value;
|
||||
const loginPassword = document.getElementById('loginPassword').value;
|
||||
|
||||
document.getElementById('registerUsername').value = loginUsername;
|
||||
document.getElementById('registerPassword').value = loginPassword;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user