CoreFiles by mySites.guru
admin-select-modal.js38 lines, 1,258 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
35c6ce1c2e2d61d135256855f06db07d
sha1
376c89fadee3754e15d01294a5e29b3a8814796e
sha256
87c751b495d66c755bb368fbfee78507e2934a65f00c15f1ec30dd62b3f5842d
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright  (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(function (document) {
  'use strict';

  document.addEventListener('DOMContentLoaded', function () {
    var elems = document.querySelectorAll('#new-modules-list a.select-link');
    elems.forEach(function (elem) {
      elem.addEventListener('click', function (_ref) {
        var currentTarget = _ref.currentTarget,
            target = _ref.target;
        var 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;
          }
        }

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

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

The same content is in 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.