(config = { overlay: true, blur: false })
| 1 | class Pushbar { |
| 2 | constructor(config = { overlay: true, blur: false }) { |
| 3 | this.activeId; |
| 4 | this.activeElement; |
| 5 | this.overlayElement; |
| 6 | if (config.overlay) { |
| 7 | this.overlayElement = document.createElement('div'); |
| 8 | this.overlayElement.classList.add('pushbar_overlay'); |
| 9 | document.querySelector('body').appendChild(this.overlayElement); |
| 10 | } |
| 11 | if (config.blur) { |
| 12 | const mainContent = document.querySelector('.pushbar_main_content'); |
| 13 | if (mainContent) { |
| 14 | mainContent.classList.add('pushbar_blur'); |
| 15 | } |
| 16 | } |
| 17 | this.bindEvents(); |
| 18 | } |
| 19 | |
| 20 | emitOpening() { |
| 21 | const event = new CustomEvent('pushbar_opening', { bubbles: true, detail: { element: this.activeElement, id: this.activeId } }); |
nothing calls this directly
no test coverage detected