MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / constructor

Method constructor

assets/js/slider.js:2–18  ·  view source on GitHub ↗
(config = { overlay: true, blur: false })

Source from the content-addressed store, hash-verified

1class 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 } });

Callers

nothing calls this directly

Calls 1

bindEventsMethod · 0.95

Tested by

no test coverage detected