Two buttons as a row in popup

Fix hiding scroll down button while jumping
This commit is contained in:
morethanwords 2021-01-12 13:46:57 +04:00
parent 297e922c03
commit d51ba6b001
3 changed files with 18 additions and 2 deletions

View File

@ -889,7 +889,7 @@ export default class ChatBubbles {
}, 1350);
}
if(this.scrollable.isScrolledDown) {
if(this.scrollable.isScrolledDown && this.scrolledAllDown) {
this.bubblesContainer.classList.add('scrolled-down');
this.scrolledDown = true;
} else if(this.bubblesContainer.classList.contains('scrolled-down')) {

View File

@ -65,6 +65,10 @@ export default class PopupElement {
if(buttons && buttons.length) {
const buttonsDiv = document.createElement('div');
buttonsDiv.classList.add('popup-buttons');
if(buttons.length === 2) {
buttonsDiv.classList.add('popup-buttons-row');
}
const buttonsElements = buttons.map(b => {
const button = document.createElement('button');

View File

@ -97,7 +97,19 @@
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: flex-end;
align-items: flex-end;
&-row {
flex-direction: row-reverse;
justify-content: flex-start;
.btn {
& + .btn {
margin-top: 0 !important;
margin-right: .5rem;
}
}
}
.btn {
background: none;