CoreFiles by mySites.guru
admin-menus-default.es6.js42 lines, 1,184 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
95c5296efd90ab5524003787aa20d876
sha1
d87cfe052b1f0e146cf2ad9f4c104dfe88ea1e35
sha256
956f30cd7833a2a64cef3c3fe47b278da6363e763f60f1aa64aef43ca5a4ec4d
/**
* 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
 */
(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.