CoreFiles by mySites.guru
admin-select-modal.es6.js39 lines, 1,208 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
916d9b7228c288dff6d3e3f387d3918d
sha1
f5dba163e6eb1b90db01e785695db57b69f5b1ae
sha256
c8cc979061074138abe4711d4e3c81aa45643aaa606d58fde00daa1b31374080
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright  Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(document => {
  'use strict';

  document.addEventListener('DOMContentLoaded', () => {
    const elems = document.querySelectorAll('#new-modules-list a.select-link');
    elems.forEach(elem => {
      elem.addEventListener('click', ({
        currentTarget,
        target
      }) => {
        let targetElem = currentTarget; // There is some bug with events in iframe where currentTarget is "null"
        // => prevent this here by bubble up

        if (!targetElem) {
          targetElem = target;

          if (targetElem && !targetElem.classList.contains('select-link')) {
            targetElem = targetElem.parentNode;
          }
        }

        const functionName = targetElem.getAttribute('data-function');

        if (functionName && typeof window.parent[functionName] === 'function') {
          window.parent[functionName](targetElem);
        }
      });
    });
  });
})(document);

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.