CoreFiles by mySites.guru
admin-users-groups.es6.js29 lines, 889 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
590bdc82bf56f7f83bd165a08547304f
sha1
d432141c29089439bc01a36b9365e954547b403f
sha256
6a099a4179842f5c54a0663529e9dd298c00155dc2a0bad6742c65d146c70f82
/**
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

Joomla = window.Joomla || {};

((Joomla) => {
  'use strict';

  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.JText._('COM_USERS_GROUPS_CONFIRM_DELETE'))) {
              Joomla.submitform(task);
            }
            return false;
          }
        }
      }
      Joomla.submitform(task);
      return false;
    };
  });
})(Joomla);

The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.