MCPcopy Create free account
hub / github.com/AddMoreScripts/hystModal / constructor

Method constructor

src/hystmodal.js:4–22  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

2/* eslint-disable no-underscore-dangle */
3export default class HystModal {
4 constructor(props) {
5 const defaultConfig = {
6 backscroll: true,
7 linkAttributeName: 'data-hystmodal',
8 closeOnOverlay: true,
9 closeOnEsc: true,
10 closeOnButton: true,
11 waitTransitions: false,
12 catchFocus: true,
13 fixedSelectors: '*[data-hystfixed]',
14 beforeOpen: () => { },
15 afterClose: () => { },
16 };
17 this.config = Object.assign(defaultConfig, props);
18 if (this.config.linkAttributeName) {
19 this.init();
20 }
21 this._closeAfterTransition = this._closeAfterTransition.bind(this);
22 }
23
24 init() {
25 this.isOpened = false;

Callers

nothing calls this directly

Calls 1

initMethod · 0.95

Tested by

no test coverage detected