Revert some "airy" changes and rewrite style sheets to make dialogs centered but scrollable on small screens; Brighten public-room-color slightly

This commit is contained in:
schlagmichdoch 2023-11-29 17:42:19 +01:00
parent a8242cecf7
commit 69c8b91239
4 changed files with 58 additions and 74 deletions

View file

@ -688,10 +688,13 @@ class PeerUI {
class Dialog {
constructor(id) {
this.$el = $(id);
this.$el.querySelectorAll('[close]').forEach(el => {
this.$autoFocus = this.$el.querySelector('[autofocus]');
this.$xBackground = this.$el.querySelector('x-background');
this.$closeBtns = this.$el.querySelectorAll('[close]');
this.$closeBtns.forEach(el => {
el.addEventListener('click', _ => this.hide())
});
this.$autoFocus = this.$el.querySelector('[autofocus]');
Events.on('peer-disconnected', e => this._onPeerDisconnected(e.detail));
}
@ -701,8 +704,15 @@ class Dialog {
}
show() {
if (this.$xBackground) {
this.$xBackground.scrollTop = 0;
}
this.$el.setAttribute('show', true);
if (!window.isMobile && this.$autoFocus) this.$autoFocus.focus();
if (!window.isMobile && this.$autoFocus) {
this.$autoFocus.focus();
}
}
isShown() {