CoreFiles by mySites.guru
admin-menus-default.es6.js42 lines, 1,190 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
48571e2904ff1c389d8d37ec7a0417e8
sha1
cd994d8857c3864d3aa9cf56ffe39f2f7f7075eb
sha256
53f8273e2d978e721c8ed2047c3c1d830f078fd4abffca380203be5a51092ed6
/**
* 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_".concat(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);

The same content is in 4 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha11. See them all, or every version of this file.