mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 01:34:04 +00:00
* start v2 * start * run * some cleanup * remove v2 pkg again * simplify * webauthn * remove unused config * fix login path in Dockerfile * fix asset_generator.go * health handler * fix grpc web * refactor * merge * build new main.go * run new main.go * update logging pkg * fix error msg * update logging * cleanup * cleanup * go mod tidy * change localDevMode * fix customEndpoints * update logging * comments * change local flag to external configs * fix location generated go code * fix Co-authored-by: fforootd <florian@caos.ch>
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
function RenderDefaultLoginnameSuffix() {
|
|
let orgNameText = document.getElementById("orgname").value;
|
|
let userName = document.getElementById("username");
|
|
let defaultLoginNameSuffix = document.getElementById("default-login-suffix");
|
|
|
|
let iamDomain = userName.dataset.iamDomain;
|
|
let orgDomain = orgNameText.replace(" ", "-");
|
|
if (orgDomain !== "") {
|
|
defaultLoginNameSuffix.innerText = "@" + orgDomain.toLowerCase() + "." + iamDomain;
|
|
} else {
|
|
defaultLoginNameSuffix.innerText = "";
|
|
}
|
|
|
|
offsetLabel();
|
|
}
|
|
|
|
window.addEventListener('DOMContentLoaded', (event) => {
|
|
RenderDefaultLoginnameSuffix();
|
|
});
|
|
|
|
document.getElementById("orgname").addEventListener('input', function () {
|
|
RenderDefaultLoginnameSuffix();
|
|
});
|
|
|
|
function offsetLabel() {
|
|
const suffix = document.getElementById('default-login-suffix');
|
|
const suffixInput = document.getElementsByClassName('lgn-suffix-input')[0];
|
|
|
|
calculateOffset();
|
|
suffix.addEventListener("DOMCharacterDataModified", calculateOffset);
|
|
|
|
function calculateOffset() {
|
|
// add suffix width to inner right padding of the input field
|
|
if (suffix && suffixInput) {
|
|
suffixInput.style.paddingRight = `${(suffix.offsetWidth ?? 0) + 10}px`;
|
|
}
|
|
}
|
|
} |