CoreFiles by mySites.guru
admin-modules-modal.js47 lines, 1,904 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
571ffc97b94e81ce868895551dc4af59
sha1
66dc2f1747aa3b060c8b8f77172889fa42222b9e
sha256
c3905e7f4f35d976471cdfd2387fbd6bba06e14b20fa23f45a20f6abbdd1e313
/**
* 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', function () {
  'use strict';
  /** Get the elements * */

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

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

      window.parent.Joomla.editors.instances[editor].replaceSelection("{loadmodule ".concat(type, ",").concat(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(function (positionsLink) {
    positionsLink.addEventListener('click', function (event) {
      event.preventDefault();
      var position = event.target.getAttribute('data-position');
      var editor = event.target.getAttribute('data-editor'); // Insert the short tag in the editor

      window.parent.Joomla.editors.instances[editor].replaceSelection("{loadposition ".concat(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.