()
| 389 | this.sEn.onWheel(e) |
| 390 | } |
| 391 | private onMutationObserver() { |
| 392 | const observer = new MutationObserver((mutations) => { |
| 393 | mutations.forEach((mutation) => { |
| 394 | if (mutation.type === "childList") { |
| 395 | let isResizing = false |
| 396 | if (mutation.removedNodes.length > 0) { |
| 397 | |
| 398 | mutation.removedNodes.forEach(removedNode => { |
| 399 | |
| 400 | if (removedNode.nodeType === Node.ELEMENT_NODE) { |
| 401 | if ((removedNode as Element).getAttribute('data-string-fixed') == null) { |
| 402 | isResizing = true |
| 403 | } else { |
| 404 | |
| 405 | } |
| 406 | this.animations.forEach((animation) => { |
| 407 | Array.from(animation.allObjects).map(([name, value]) => { |
| 408 | if(document.body.contains(value.el) == false){ |
| 409 | animation.removeObject(value.id) |
| 410 | } |
| 411 | }); |
| 412 | }) |
| 413 | } |
| 414 | }) |
| 415 | if (isResizing) { |
| 416 | this.onResize() |
| 417 | } |
| 418 | } |
| 419 | if (mutation.addedNodes.length > 0) { |
| 420 | mutation.addedNodes.forEach(addedNode => { |
| 421 | if (addedNode.nodeType === Node.ELEMENT_NODE) { |
| 422 | if ((addedNode as Element).getAttribute('data-string-fixed') == null) { |
| 423 | isResizing = true |
| 424 | } else { |
| 425 | } |
| 426 | } |
| 427 | }) |
| 428 | |
| 429 | |
| 430 | this.animations.forEach((animation) => { |
| 431 | let elements = document.querySelectorAll(`[${animation.key}]:not([data-string-connect]):not([${animation.key}-inited])`) |
| 432 | elements.forEach(element => { |
| 433 | animation.addObject(element) |
| 434 | }); |
| 435 | }); |
| 436 | if (isResizing) { |
| 437 | this.onResize() |
| 438 | } |
| 439 | } |
| 440 | |
| 441 | } |
| 442 | }); |
| 443 | }); |
| 444 | const config = { |
| 445 | attributes: true, |
| 446 | childList: true, |
| 447 | subtree: true |
| 448 | }; |
no test coverage detected