(popupTitle, buttons, hidden)
| 1643 | } |
| 1644 | //creates a full box popup. |
| 1645 | createPopup(popupTitle, buttons, hidden) { |
| 1646 | if (!hidden) this.closePopup(); |
| 1647 | const popup = this.createElement("div"); |
| 1648 | popup.classList.add("ejs_popup_container"); |
| 1649 | this.elements.parent.appendChild(popup); |
| 1650 | const title = this.createElement("h4"); |
| 1651 | title.innerText = this.localization(popupTitle); |
| 1652 | const main = this.createElement("div"); |
| 1653 | main.classList.add("ejs_popup_body"); |
| 1654 | |
| 1655 | popup.appendChild(title); |
| 1656 | popup.appendChild(main); |
| 1657 | |
| 1658 | const padding = this.createElement("div"); |
| 1659 | padding.style["padding-top"] = "10px"; |
| 1660 | popup.appendChild(padding); |
| 1661 | |
| 1662 | for (let k in buttons) { |
| 1663 | const button = this.createElement("a"); |
| 1664 | if (buttons[k] instanceof Function) { |
| 1665 | button.addEventListener("click", (e) => { |
| 1666 | buttons[k](); |
| 1667 | e.preventDefault(); |
| 1668 | }); |
| 1669 | } |
| 1670 | button.classList.add("ejs_button"); |
| 1671 | button.innerText = this.localization(k); |
| 1672 | popup.appendChild(button); |
| 1673 | } |
| 1674 | if (!hidden) { |
| 1675 | this.currentPopup = popup; |
| 1676 | } else { |
| 1677 | popup.style.display = "none"; |
| 1678 | } |
| 1679 | |
| 1680 | return main; |
| 1681 | } |
| 1682 | selectFile() { |
| 1683 | return new Promise((resolve, reject) => { |
| 1684 | const file = this.createElement("input"); |
no test coverage detected