CoreFiles by mySites.guru
admin-menus-default.es6.js42 lines, 1,109 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
f78a45abb755574051143e84d04df3c9
sha1
1697902259db0f13e41a867b009f0c086a48e5ef
sha256
10bc849d0eabb01ef35b99d58507b5ccd535f68607739b2f3fefc62ca2efcdb7
/**
* 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 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(Joomla => {
  'use strict';

  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 => {
  'use strict';

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

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

The same content is in 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.