Add maxlength attribute to team name (see 608488a)

This commit is contained in:
yflory 2023-09-19 15:54:21 +02:00
parent 4c83721c28
commit c5259c561d
2 changed files with 3 additions and 6 deletions

View File

@ -148,7 +148,6 @@
.cp-team-list-name {
word-wrap: break-word;
min-width: 0;
overflow: hidden;
white-space: pre-wrap;
text-overflow: ellipsis;
max-width: 250px;

View File

@ -530,9 +530,9 @@ define([
}
content.push(h('h3', Messages.team_createLabel));
let label = h('label', { for: 'teamName' } , Messages.team_createName);
let label = h('label', { for: 'cp-team-name' } , Messages.team_createName);
content.push(label);
let input = h('input', {type:'text', id:'teamName'});
let input = h('input', {type:'text', id:'cp-team-name', maxlength:50});
content.push(input);
var button = h('button.btn.btn-success', Messages.creation_create);
content.push(h('br'));
@ -546,9 +546,7 @@ define([
var name = $(input).val();
if (!name.trim()) { return; }
Messages.team_nameTooLong = "Team name is too long"; // XXX
if(name.length > 50){
return UI.warn(Messages.team_nameTooLong);
}
if(name.length > 50) { return UI.warn(Messages.team_nameTooLong); }
state = true;
$spinner.show();
APP.module.execCommand('CREATE_TEAM', {