fixed ctrl click functionality to Schedule.vue

This commit is contained in:
Sockenklaus
2021-10-11 11:57:11 +02:00
parent 9d8b3c27a2
commit d2d689af17

View File

@@ -34,7 +34,7 @@ AddEmployeeModal(
:key="dIndex"
:class="{'bg-secondary bg-opacity-10' : row.dates[dIndex] === null, 'selected' : isSelected({mIndex, rIndex, eIndex, dIndex})}"
@click="select({mIndex, rIndex, eIndex, dIndex}, $event)"
)  
) m={{mIndex}}, r={{rIndex}}, e={{eIndex}}, d={{dIndex}}
tr()
td.text-end
button(
@@ -185,9 +185,11 @@ AddEmployeeModal(
}
function isSelected(c : Coordinates) : boolean {
return selected.value.some(el => {
return el.mIndex === c.mIndex && el.rIndex === c.rIndex && el.eIndex === c.rIndex && el.dIndex === c.dIndex
let temp : boolean = selected.value.some(el => {
return el.mIndex === c.mIndex && el.rIndex === c.rIndex && el.eIndex === c.eIndex && el.dIndex === c.dIndex
})
return temp
}
/**
@@ -201,15 +203,18 @@ AddEmployeeModal(
}
function select(coord : Coordinates, e : MouseEvent) {
if(e.ctrlKey){
selected.value.push(coord)
}
else {
selected.value = []
selected.value.push(coord)
if(selected.value.length > 1 || !isSelected(coord)) {
selected.value = []
selected.value.push(coord)
}
else {
selected.value = []
}
}
}
/**
@@ -225,6 +230,9 @@ AddEmployeeModal(
table {
table-layout: fixed
}
table td {
cursor: pointer;
}
.o-acp__item.list-group-item:hover {
background-color: aliceblue !important;