mirror of
https://github.com/anatolykopyl/variants.git
synced 2026-03-26 12:54:36 +00:00
Исправил удаление имен
This commit is contained in:
@@ -72,10 +72,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeName() {
|
function removeName() {
|
||||||
const index = room.teams[highlightedTeam].indexOf(highlightedName);
|
room.teams[highlightedTeam] = room.teams[highlightedTeam].filter(n => n !== highlightedName);
|
||||||
if (index > -1) {
|
|
||||||
room.teams[highlightedTeam].splice(index, 1);
|
|
||||||
}
|
|
||||||
var url = `http://localhost:3000/api/delete/?id=${parsed.id}&name=${highlightedName}&team=${highlightedTeam}`;
|
var url = `http://localhost:3000/api/delete/?id=${parsed.id}&name=${highlightedName}&team=${highlightedTeam}`;
|
||||||
fetch(url);
|
fetch(url);
|
||||||
}
|
}
|
||||||
@@ -93,8 +90,8 @@
|
|||||||
{#each room.teams as _, i}
|
{#each room.teams as _, i}
|
||||||
<li class={room.group === "true" ? "group" : "individual"} on:click={() => selectInput(i)} style="border-color: {enabledInput==i ? 'gray' : 'lightgray'}">
|
<li class={room.group === "true" ? "group" : "individual"} on:click={() => selectInput(i)} style="border-color: {enabledInput==i ? 'gray' : 'lightgray'}">
|
||||||
{#each room.teams[i] as name}
|
{#each room.teams[i] as name}
|
||||||
<span class="name" style="background-color: {name.toColor()}" on:click={() => highlightName(name, i)}>
|
<span class="name" style="background-color: {name.toColor()}">
|
||||||
{name}
|
<span on:click={() => highlightName(name, i)}>{name}</span>
|
||||||
{#if (i === highlightedTeam && name === highlightedName)}
|
{#if (i === highlightedTeam && name === highlightedName)}
|
||||||
<span class="deleteName" on:click={removeName}>×</span>
|
<span class="deleteName" on:click={removeName}>×</span>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -145,13 +142,13 @@
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
height: 2em;
|
height: 2em;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
overflow: hidden;
|
overflow: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
border-radius: 8px;
|
border-radius: 5px;
|
||||||
padding: 3px 8px 3px 8px;
|
padding: 3px 8px 3px 8px;
|
||||||
margin: 0px 15px 0px 15px;
|
margin: 0px 0px 0px 15px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,12 +192,12 @@
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
content: counter(item);
|
content: counter(item);
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
color: white;
|
|
||||||
width: 1.2em;
|
width: 1.2em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
.individual:before {
|
.individual:before {
|
||||||
background-color: #2196F3;
|
background-color: #2196F3;
|
||||||
}
|
}
|
||||||
@@ -208,6 +205,7 @@
|
|||||||
.group:before {
|
.group:before {
|
||||||
background-color: #f57323;
|
background-color: #f57323;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@media only screen and (max-width: 1024px) {
|
@media only screen and (max-width: 1024px) {
|
||||||
ol {
|
ol {
|
||||||
|
|||||||
Reference in New Issue
Block a user