CoreFiles by mySites.guru
admin-menus-default-es5.js39 lines, 1,120 bytes, from Joomla_4.0.1-Stable-Full_Package.zip
Raw History Compare with 4.0.0
md5
e3620a4c06fba07c768c1620c670e9e1
sha1
149847b23eab396c8b7beadedfa0c2eea3cc066d
sha256
7538f54b7d83070a6a1f090f7d53de78f1048e2ef29e1ed59a47d1f2b4a9b5c4
(function () {
  'use strict';

  /**
   * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   */
  (function (Joomla) {
    if (Joomla.getOptions('menus-default')) {
      // eslint-disable-next-line prefer-destructuring
      var items = Joomla.getOptions('menus-default').items;
      items.forEach(function (item) {
        window["jSelectPosition_" + item] = function (name) {
          document.getElementById(item).value = name;
          Joomla.Modal.getCurrent().close();
        };
      });
    }

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

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

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

}());

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