|
|
@ -66,6 +66,10 @@ export default class PopupElement { |
|
|
|
const buttonsDiv = document.createElement('div'); |
|
|
|
const buttonsDiv = document.createElement('div'); |
|
|
|
buttonsDiv.classList.add('popup-buttons'); |
|
|
|
buttonsDiv.classList.add('popup-buttons'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(buttons.length === 2) { |
|
|
|
|
|
|
|
buttonsDiv.classList.add('popup-buttons-row'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const buttonsElements = buttons.map(b => { |
|
|
|
const buttonsElements = buttons.map(b => { |
|
|
|
const button = document.createElement('button'); |
|
|
|
const button = document.createElement('button'); |
|
|
|
button.className = 'btn' + (b.isDanger ? ' danger' : ''); |
|
|
|
button.className = 'btn' + (b.isDanger ? ' danger' : ''); |
|
|
|