length requirement for custom roles

This commit is contained in:
AlecM33
2021-12-28 00:48:53 -05:00
parent 9920ce4055
commit e3094ae1a8
2 changed files with 9 additions and 1 deletions

View File

@@ -455,6 +455,14 @@ function initializeRemainingEventListeners(deckManager) {
let description = document.getElementById("role-description").value.trim();
let team = document.getElementById("role-alignment").value.toLowerCase().trim();
if (!deckManager.getCustomRoleOption(name)) { // confirm there is no existing custom role with the same name
if (name.length > 40) {
toast('Your name is too long (max 40 characters).', "error", true);
return;
}
if (description.length > 500) {
toast('Your description is too long (max 500 characters).', "error", true);
return;
}
deckManager.addToCustomRoleOptions({role: name, description: description, team: team});
updateCustomRoleOptionsList(deckManager, document.getElementById("deck-select"))
ModalManager.dispelModal("add-role-modal", "add-role-modal-background");

View File

@@ -138,7 +138,7 @@ form {
select {
padding: 10px;
font-size: 18px;
font-size: 16px;
font-family: 'signika-negative', sans-serif;
background-color: transparent;
color: #d7d7d7;