Skip to content

Commit

Permalink
feat(call): list participants grid/stripe with a mouse wheel
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy authored and backportbot[bot] committed Sep 23, 2024
1 parent 03e90bf commit b522ffc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/components/CallView/Grid/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
:class="{stripe: isStripe}"
:style="gridStyle"
@mousemove="handleMovement"
@wheel="debounceHandleWheelEvent"
@keydown="handleMovement">
<template v-if="!devMode && (!isLessThanTwoVideos || !isStripe)">
<EmptyCallView v-if="videos.length === 0 && !isStripe" class="video" :is-grid="true" />
Expand Down Expand Up @@ -263,6 +264,7 @@ export default {
// Timer for the videos bottom bar
showVideoOverlayTimer: null,
debounceMakeGrid: () => {},
debounceHandleWheelEvent: () => {},
tempPromotedModels: [],
unpromoteSpeakerTimer: {},
promotedHistoryMask: [],
Expand Down Expand Up @@ -608,6 +610,7 @@ export default {
// bind event handlers to the `handleResize` method
mounted() {
this.debounceMakeGrid = debounce(this.makeGrid, 200)
this.debounceHandleWheelEvent = debounce(this.handleWheelEvent, 50)
window.addEventListener('resize', this.handleResize)
subscribe('navigation-toggled', this.handleResize)
this.makeGrid()
Expand All @@ -616,6 +619,7 @@ export default {
},
beforeDestroy() {
this.debounceMakeGrid.clear?.()
this.debounceHandleWheelEvent.clear?.()
window.OCA.Talk.gridDebugInformation = () => console.debug('Not in a call')
window.removeEventListener('resize', this.handleResize)
Expand Down Expand Up @@ -868,6 +872,18 @@ export default {
// this.shrinkGrid(this.displayedVideos.length)
// },
handleWheelEvent(event) {
if (this.gridWidth <= 0) {
return
}
if (event.deltaY < 0 && this.hasPreviousPage) {
this.handleClickPrevious()
} else if (event.deltaY > 0 && this.hasNextPage) {
this.handleClickNext()
}
},
handleClickNext() {
this.currentPage++
console.debug('handleclicknext, ', 'currentPage ', this.currentPage, 'slots ', this.slot, 'videos.length ', this.videos.length)
Expand Down

0 comments on commit b522ffc

Please sign in to comment.