All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.frontend.cookieConsentConnector.js Maven / Gradle / Ivy

There is a newer version: 24.5.5
Show newest version
(function () {
  function copyClassName(consent) {
    const popup = consent._getPopup();
    if (popup) {
      popup.className = consent.className;
    }
  }

  const observer = new MutationObserver((records) => {
    records.forEach((mutation) => {
      if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
        copyClassName(mutation.target);
      }
    });
  });

  window.Vaadin.Flow.cookieConsentConnector = {
    initLazy: function (consent) {
      if (consent.$connector) {
        return;
      }

      consent.$connector = {};

      observer.observe(consent, {
        attributes: true,
        attributeFilter: ['class']
      });

      copyClassName(consent);
    }
  };
})();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy