CoreFiles by mySites.guru
admin-menus-default.es6.js35 lines, 1,053 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
3938dc35ac8e6b52f26ff0b351d441ba
sha1
b1e7902b86e965f521d41274edbb0007d655e0de
sha256
9020da20cba10817a951e16a7a66b2c04c6fac3d7d639b9d6183231bf958d727
/**
 * @copyright  Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
((Joomla) => {
  'use strict';

  document.addEventListener('DOMContentLoaded', () => {
    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();
        };
      });
    }

    // @Todo make vanilla, when modals are custom elements
    window.jQuery('.modal').on('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);

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