CoreFiles by mySites.guru
admin-users-groups.js27 lines, 857 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
da23fd3b0a0f31970062a5b3f8a87af2
sha1
6f7bfffa3d7e39abb518e83635ae63215f05a3e3
sha256
5c6845cf79f49de4ab95a4da016893a92362b999763706d10e22a152b2fb39d4
/**
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

Joomla = window.Joomla || {};
(Joomla => {

  document.addEventListener('DOMContentLoaded', () => {
    Joomla.submitbutton = task => {
      if (task === 'groups.delete') {
        const cids = document.getElementsByName('cid[]');
        for (let i = 0; i < cids.length; i += 1) {
          if (cids[i].checked && cids[i].parentNode.getAttribute('data-usercount') !== '0') {
            // @todo replace with joomla-alert
            if (window.confirm(Joomla.Text._('COM_USERS_GROUPS_CONFIRM_DELETE'))) {
              Joomla.submitform(task);
            }
            return false;
          }
        }
      }
      Joomla.submitform(task);
      return false;
    };
  });
})(Joomla);

The same content is in 211 releases, Joomla 4.3.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.