mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
35 lines
797 B
JavaScript
35 lines
797 B
JavaScript
export const toggleRowDetails = {
|
|
data() {
|
|
return {
|
|
slotIndex: 0,
|
|
openRow: null,
|
|
creationUserData: {},
|
|
}
|
|
},
|
|
methods: {
|
|
rowToggleDetails(row, index) {
|
|
if (this.openRow) {
|
|
if (this.openRow.index === row.index) {
|
|
if (index === this.slotIndex) {
|
|
row.toggleDetails()
|
|
this.openRow = null
|
|
} else {
|
|
this.slotIndex = index
|
|
}
|
|
} else {
|
|
this.openRow.toggleDetails()
|
|
row.toggleDetails()
|
|
this.slotIndex = index
|
|
this.openRow = row
|
|
this.creationUserData = row.item
|
|
}
|
|
} else {
|
|
row.toggleDetails()
|
|
this.slotIndex = index
|
|
this.openRow = row
|
|
this.creationUserData = row.item
|
|
}
|
|
},
|
|
},
|
|
}
|