CoreFiles by mySites.guru
admin-menus-default-es5.js39 lines, 1,120 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
247b453749994b00cf38ec081b1a6542
sha1
513c784d1dd9be7bf4ae78b30a003c7c50126ffb
sha256
10772dd8f10052cca40abe5fc6e9234c4822b760a3278a1e7cf69eefc0ac2991
(function () {
  'use strict';

  /**
   * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   */
  (function (Joomla) {
    if (Joomla.getOptions('menus-default')) {
      // eslint-disable-next-line prefer-destructuring
      var items = Joomla.getOptions('menus-default').items;
      items.forEach(function (item) {
        window["jSelectPosition_" + item] = function (name) {
          document.getElementById(item).value = name;
          Joomla.Modal.getCurrent().close();
        };
      });
    }

    Array.from(document.querySelectorAll('.modal')).forEach(function (modalEl) {
      modalEl.addEventListener('hidden.bs.modal', function () {
        setTimeout(function () {
          window.parent.location.reload();
        }, 1000);
      });
    });
  })(Joomla);

  (function (originalFn) {
    Joomla.submitform = function (task, form) {
      originalFn(task, form);

      if (task === 'menu.exportXml') {
        document.adminForm.task.value = '';
      }
    };
  })(Joomla.submitform);

})();

The same content is in 45 releases, Joomla 4.0.6-rc1 to 4.2.9. See them all, or every version of this file.