CoreFiles by mySites.guru
admin-modules-modal.es6.js47 lines, 1,850 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
713eadcfcfc71bdff927b186353cf7cb
sha1
045bd8adb77287ef2bc7da125b7a14e975a796f1
sha256
3cbfed0248b3b2e5517cefa1865272bed940c7c94d498acf0abd3695596e43b9
/**
* 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 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
document.addEventListener('DOMContentLoaded', () => {
  'use strict';
  /** Get the elements * */

  const modulesLinks = [].slice.call(document.querySelectorAll('.js-module-insert'));
  const positionsLinks = [].slice.call(document.querySelectorAll('.js-position-insert'));
  /** Assign listener for click event (for single module insertion) * */

  modulesLinks.forEach(modulesLink => {
    modulesLink.addEventListener('click', event => {
      event.preventDefault();
      const type = event.target.getAttribute('data-module');
      const name = event.target.getAttribute('data-title');
      const editor = event.target.getAttribute('data-editor'); // Insert the short tag in the editor

      window.parent.Joomla.editors.instances[editor].replaceSelection(`{loadmodule ${type},${name}}`); // Close the modal

      if (window.parent.Joomla.Modal) {
        window.parent.Joomla.Modal.getCurrent().close();
      }
    });
  });
  /** Assign listener for click event (for position insertion) * */

  positionsLinks.forEach(positionsLink => {
    positionsLink.addEventListener('click', event => {
      event.preventDefault();
      const position = event.target.getAttribute('data-position');
      const editor = event.target.getAttribute('data-editor'); // Insert the short tag in the editor

      window.parent.Joomla.editors.instances[editor].replaceSelection(`{loadposition ${position}}`); // Close the modal

      if (window.parent.Joomla.Modal) {
        window.parent.Joomla.Modal.getCurrent().close();
      }
    });
  });
});

No other release has this exact content. See every version of this file.