| 2 | /* eslint-disable no-underscore-dangle */ |
| 3 | export 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; |