Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move layout hint event to a watcher
Instead of being explicitly emitted in "makeGrid" the layout hint is now
automatically emitted based on the value of the computed properties that
it depends on.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu committed Jan 14, 2021
commit 567f83aec8d7f71f178c134b3385d33fee0bee2c
29 changes: 22 additions & 7 deletions src/components/CallView/Grid/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,21 @@ export default {
stripeOpen() {
return this.$store.getters.isStripeOpen
},

// Special boolean property to watch and emit the "toggleLayoutHint"
// event to display hint in the topbar component if there is an overflow
// of videos (only if in full-grid mode, not stripe)
toggleLayoutHint() {
if (!this.hasVideoOverflow) {
return false
}

if (this.isStripe) {
return false
}

return true
},
},

watch: {
Expand Down Expand Up @@ -489,6 +504,13 @@ export default {
this.currentPage = this.numberOfPages - 1
}
},

toggleLayoutHint: {
immediate: true,
handler() {
EventBus.$emit('toggleLayoutHint', this.toggleLayoutHint)
},
},
},

// bind event handlers to the `handleResize` method
Expand Down Expand Up @@ -560,13 +582,6 @@ export default {
} else {
this.shrinkGrid(this.videosCount)
}
// Send event to display hint in the topbar component if there's an
// overflow of videos (only if in full-grid mode, not stripe)
if (!this.hasVideoOverflow || this.isStripe) {
EventBus.$emit('toggleLayoutHint', false)
} else {
EventBus.$emit('toggleLayoutHint', true)
}
},

// Fine tune the number of rows and columns of the grid
Expand Down