CoreFiles by mySites.guru
admin-menus-default.js36 lines, 965 bytes, from Joomla_4.2.7-Stable-Full_Package.zip
Raw History Compare with 4.2.6
md5
919af575ac9516785234b0ea2af4a3bc
sha1
a336cd3d4d834bd3ae8bc9ab9909d3a2745c6287
sha256
5464d37d25def25814f262e9ec03a168b19b4f108f1fac2d60e36ca3fcf5a4e8
/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(Joomla => {

  if (Joomla.getOptions('menus-default')) {
    // eslint-disable-next-line prefer-destructuring
    const items = Joomla.getOptions('menus-default').items;
    items.forEach(item => {
      window[`jSelectPosition_${item}`] = name => {
        document.getElementById(item).value = name;
        Joomla.Modal.getCurrent().close();
      };
    });
  }

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

(originalFn => {

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

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

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