Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PresenterOverlay): fix RTL check #14329

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 0 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ export default {
this.$store.dispatch('joinConversation', { token: this.$route.params.token })
}

window.addEventListener('resize', this.onResize)

this.onResize()

window.addEventListener('unload', () => {
console.info('Navigating away, leaving conversation')
if (this.token) {
Expand Down Expand Up @@ -539,10 +535,6 @@ export default {
this.fetchSingleConversation(this.token)
},

onResize() {
this.windowHeight = window.innerHeight - document.getElementById('header').clientHeight
},

preventUnload(event) {
if (!this.warnLeaving && !this.isSendingMessages) {
return
Expand Down
11 changes: 5 additions & 6 deletions src/components/CallView/shared/PresenterOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:resizable="false"
:h="presenterOverlaySize"
:w="presenterOverlaySize"
:x="isRTL ? parentWidth - presenterOverlaySize - 10 : 10"
:x="isDirectionRTL ? parentWidth - presenterOverlaySize - 10 : 10"
:y="10"
@dragging="isDragging = true"
@dragstop="isDragging = false">
Expand Down Expand Up @@ -62,6 +62,8 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import LocalVideo from './LocalVideo.vue'
import VideoVue from './VideoVue.vue'

const isDirectionRTL = isRTL()

export default {
name: 'PresenterOverlay',

Expand Down Expand Up @@ -111,7 +113,7 @@ export default {
const parentWidth = ref(document.getElementById('videos').getBoundingClientRect().width)
return {
parentWidth,
isRTL,
isDirectionRTL,
}
},

Expand All @@ -124,15 +126,11 @@ export default {
},

mounted() {
window.addEventListener('resize', this.updateSize)

this.resizeObserver = new ResizeObserver(this.updateSize)
this.resizeObserver.observe(this.$refs.presenterOverlay.$el.parentElement)
},

beforeDestroy() {
window.removeEventListener('resize', this.updateSize)

if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
Expand All @@ -147,6 +145,7 @@ export default {
// FIXME: inner method should be triggered to re-parent element
this.$refs.presenterOverlay.checkParentSize()
// FIXME: if it stays out of bounds (right and bottom), bring it back
// FIXME: should consider RTL
if (this.$refs.presenterOverlay.right < 0) {
this.$refs.presenterOverlay.moveHorizontally(this.$refs.presenterOverlay.parentWidth - this.presenterOverlaySize)
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/MessagesList/MessagesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ export default {
subscribe('networkOnline', this.handleNetworkOnline)
window.addEventListener('focus', this.onWindowFocus)

window.addEventListener('resize', this.updateSize)
this.resizeObserver = new ResizeObserver(this.updateSize)
this.resizeObserver.observe(this.$refs.scroller)

Expand All @@ -368,7 +367,6 @@ export default {
unsubscribe('networkOffline', this.handleNetworkOffline)
unsubscribe('networkOnline', this.handleNetworkOnline)

window.removeEventListener('resize', this.updateSize)
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
Expand Down
Loading