Browse Source

Fix emoji animation container position

master
Eduard Kuzmenko 3 years ago
parent
commit
bd06984e5e
  1. 15
      src/lib/appManagers/appImManager.ts

15
src/lib/appManagers/appImManager.ts

@ -183,7 +183,7 @@ export class AppImManager { @@ -183,7 +183,7 @@ export class AppImManager {
this.emojiAnimationContainer = document.createElement('div');
this.emojiAnimationContainer.classList.add('emoji-animation-container');
document.body.append(this.emojiAnimationContainer);
this.appendEmojiAnimationContainer(mediaSizes.activeScreen);
this.columnEl.append(this.chatsContainer);
@ -213,11 +213,7 @@ export class AppImManager { @@ -213,11 +213,7 @@ export class AppImManager {
appSidebarRight.toggleSidebar(false);
}
if(from === ScreenSize.mobile) {
document.body.append(this.emojiAnimationContainer);
} else if(to === ScreenSize.mobile) {
this.columnEl.append(this.emojiAnimationContainer);
}
this.appendEmojiAnimationContainer(to);
});
rootScope.addEventListener('history_focus', (e) => {
@ -554,6 +550,13 @@ export class AppImManager { @@ -554,6 +550,13 @@ export class AppImManager {
this.attachKeydownListener();
}
private appendEmojiAnimationContainer(screen: ScreenSize) {
const appendTo = screen === ScreenSize.mobile ? this.columnEl : document.body;
if(this.emojiAnimationContainer.parentElement !== appendTo) {
appendTo.append(this.emojiAnimationContainer)
}
}
private attachKeydownListener() {
const IGNORE_KEYS = new Set(['PageUp', 'PageDown', 'Meta', 'Control']);
const onKeyDown = (e: KeyboardEvent) => {

Loading…
Cancel
Save