Skip to content

Commit

Permalink
Fix: mobile/emoji-picker - adjust position
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Jan 1, 2023
1 parent 50f5f24 commit 0e0dec7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/client/app/common/views/components/emoji-picker-dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export default Vue.extend({
mounted() {
this.$nextTick(() => {
const width = this.$el.offsetWidth;
// const width = this.$el.offsetWidth;
const width = (this.$el.offsetWidth ? this.$el.offsetWidth : 350);
const height = this.$el.offsetHeight;
let x = this.x;
Expand All @@ -40,8 +41,13 @@ export default Vue.extend({
y = window.innerHeight - height + window.pageYOffset;
}
this.$el.style.left = x + 'px';
this.$el.style.top = y + 'px';
if (this.$root.isMobile) {
this.$el.style.left = (window.innerWidth / 2) - (width / 2) + 'px';
this.$el.style.top = y + 40 + 'px';
} else {
this.$el.style.left = x + 'px';
this.$el.style.top = y + 'px';
}
for (const el of Array.from(document.querySelectorAll('body *'))) {
el.addEventListener('mousedown', this.onMousedown);
Expand Down

0 comments on commit 0e0dec7

Please sign in to comment.