CoreFiles by mySites.guru
admin-select-modal.js38 lines, 1,271 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
2524b51aa39568b75de893c78ebc1a07
sha1
ded306504cdb40976bc06d8e8fbf19b2ddc38644
sha256
2e749fe8216edb04472570f95b7090a8441a40c40f0b269e0af77725215d4e26
/**
* 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
 */
(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 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.