From 4af77e2480872d43b65a90666878665e7f00a9db Mon Sep 17 00:00:00 2001 From: N-Pex Date: Tue, 23 May 2023 10:20:42 +0200 Subject: [PATCH] Handle RTL for avatar popup --- src/components/Chat.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/Chat.vue b/src/components/Chat.vue index ab5f466..d705ada 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -514,19 +514,24 @@ export default { // const ref = this.selectedEvent && this.$refs[this.selectedEvent.getId()]; var top = 0; - var left = 0; + var left = "unset"; + var right = "unset"; if (ref && ref[0]) { if (this.showAvatarMenuAnchor) { var rectAnchor = this.showAvatarMenuAnchor.getBoundingClientRect(); var rectChat = this.$refs.avatarOperationsStrut.getBoundingClientRect(); top = rectAnchor.top - rectChat.top; - left = rectAnchor.left - rectChat.left; + if (this.$vuetify.rtl) { + right = (rectAnchor.right - rectChat.right)+ "px"; + } else { + left = (rectAnchor.left - rectChat.left) + "px"; + } // if (left + 250 > rectChat.right) { // left = rectChat.right - 250; // Pretty ugly, but we want to make sure it does not escape the screen, and we don't have the exakt width of it (yet)! // } } } - return "top:" + top + "px;left:" + left + "px"; + return "top:" + top + "px;left:" + left + ";right:" + right; }, canRecordAudio() { return util.browserCanRecordAudio();