Skip to content

Commit

Permalink
Merge pull request #13374 from nextcloud/backport/13219/stable30
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy authored Sep 25, 2024
2 parents ccc583b + b522ffc commit 77f2755
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 @@ -265,6 +266,7 @@ export default {
// Timer for the videos bottom bar
showVideoOverlayTimer: null,
debounceMakeGrid: () => {},
debounceHandleWheelEvent: () => {},
tempPromotedModels: [],
unpromoteSpeakerTimer: {},
promotedHistoryMask: [],
Expand Down Expand Up @@ -610,6 +612,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 @@ -618,6 +621,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 @@ -870,6 +874,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 77f2755

Please sign in to comment.