Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DOMNodeInserted with MutationObserver for dynamic content handling #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jul 29, 2024

  1. Replace DOMNodeInserted with MutationObserver for dynamic content han…

    …dling
    
    The `DOMNodeInserted` event is deprecated and no longer supported in recent versions of Chrome (e.g., Chrome 127 and later). This commit updates the code to use `MutationObserver`, which is a modern and recommended way to observe changes in the DOM.
    
    The MutationObserver is set up to monitor changes in the document and specifically look for newly added nodes with the class `collection-item`. When such nodes are detected, the Redactor editor is initialized for these elements.
    
    This change ensures compatibility with newer browser versions and improves performance and reliability when handling dynamic content.
    
    Changes made:
    - Replaced `DOMNodeInserted` event listener with a `MutationObserver`.
    - Updated the callback function to initialize Redactor editors for dynamically added collection items.
    JoDerGraf authored Jul 29, 2024
    Configuration menu
    Copy the full SHA
    75004fa View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from LulububuSoftwareGmbH/fix/mutation-observer…

    …-replace-dom-node-inserted
    
    Replace DOMNodeInserted with MutationObserver for dynamic content han…
    JoDerGraf authored Jul 29, 2024
    Configuration menu
    Copy the full SHA
    69e10e1 View commit details
    Browse the repository at this point in the history