Browse Source

Two buttons as a row in popup

Fix hiding scroll down button while jumping
master
morethanwords 4 years ago
parent
commit
10fbde2bc7
  1. 2
      src/components/chat/bubbles.ts
  2. 4
      src/components/popups/index.ts
  3. 12
      src/scss/partials/popups/_popup.scss

2
src/components/chat/bubbles.ts

@ -889,7 +889,7 @@ export default class ChatBubbles { @@ -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')) {

4
src/components/popups/index.ts

@ -66,6 +66,10 @@ export default class PopupElement { @@ -66,6 +66,10 @@ export default class PopupElement {
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');
button.className = 'btn' + (b.isDanger ? ' danger' : '');

12
src/scss/partials/popups/_popup.scss

@ -99,6 +99,18 @@ @@ -99,6 +99,18 @@
justify-content: 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;
outline: none;

Loading…
Cancel
Save