fixed ctrl click functionality to Schedule.vue
This commit is contained in:
@@ -34,7 +34,7 @@ AddEmployeeModal(
|
|||||||
:key="dIndex"
|
:key="dIndex"
|
||||||
:class="{'bg-secondary bg-opacity-10' : row.dates[dIndex] === null, 'selected' : isSelected({mIndex, rIndex, eIndex, dIndex})}"
|
:class="{'bg-secondary bg-opacity-10' : row.dates[dIndex] === null, 'selected' : isSelected({mIndex, rIndex, eIndex, dIndex})}"
|
||||||
@click="select({mIndex, rIndex, eIndex, dIndex}, $event)"
|
@click="select({mIndex, rIndex, eIndex, dIndex}, $event)"
|
||||||
)
|
) m={{mIndex}}, r={{rIndex}}, e={{eIndex}}, d={{dIndex}}
|
||||||
tr()
|
tr()
|
||||||
td.text-end
|
td.text-end
|
||||||
button(
|
button(
|
||||||
@@ -185,9 +185,11 @@ AddEmployeeModal(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isSelected(c : Coordinates) : boolean {
|
function isSelected(c : Coordinates) : boolean {
|
||||||
return selected.value.some(el => {
|
let temp : boolean = selected.value.some(el => {
|
||||||
return el.mIndex === c.mIndex && el.rIndex === c.rIndex && el.eIndex === c.rIndex && el.dIndex === c.dIndex
|
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) {
|
function select(coord : Coordinates, e : MouseEvent) {
|
||||||
|
|
||||||
if(e.ctrlKey){
|
if(e.ctrlKey){
|
||||||
selected.value.push(coord)
|
selected.value.push(coord)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
selected.value = []
|
if(selected.value.length > 1 || !isSelected(coord)) {
|
||||||
selected.value.push(coord)
|
selected.value = []
|
||||||
|
selected.value.push(coord)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
selected.value = []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -225,6 +230,9 @@ AddEmployeeModal(
|
|||||||
table {
|
table {
|
||||||
table-layout: fixed
|
table-layout: fixed
|
||||||
}
|
}
|
||||||
|
table td {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
.o-acp__item.list-group-item:hover {
|
.o-acp__item.list-group-item:hover {
|
||||||
background-color: aliceblue !important;
|
background-color: aliceblue !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user