(pos = true)
| 237 | } |
| 238 | |
| 239 | enable(pos = true) { |
| 240 | const { classes, classPrefix } = this.options; |
| 241 | if (!(this.options.addTargetClasses === false)) { |
| 242 | addClass(this.target, getClass('enabled', classes, classPrefix)); |
| 243 | } |
| 244 | addClass(this.element, getClass('enabled', classes, classPrefix)); |
| 245 | this.enabled = true; |
| 246 | |
| 247 | this.scrollParents.forEach((parent) => { |
| 248 | if (parent !== this.target.ownerDocument) { |
| 249 | parent.addEventListener('scroll', this.position); |
| 250 | } |
| 251 | }); |
| 252 | |
| 253 | if (pos) { |
| 254 | this.position(); |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | disable() { |
| 259 | const { classes, classPrefix } = this.options; |
no test coverage detected