CoreFiles by mySites.guru
admin-users-groups.js36 lines, 1,037 bytes, from Joomla_4.0.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta
md5
62259f6fe03da6fd46277d4d327091ed
sha1
d5838e6953b1c18600189997cf09de93f53c6baa
sha256
ef6d1fec0ee7ea016b400ece31d4fb8f8cf51743750ed27768134340c1956c77
/**
* 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 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
Joomla = window.Joomla || {};

(function (Joomla) {
  'use strict';

  document.addEventListener('DOMContentLoaded', function () {
    Joomla.submitbutton = function (task) {
      if (task === 'groups.delete') {
        var cids = document.getElementsByName('cid[]');

        for (var 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 5 releases, Joomla 4.0.0-beta to 4.0.0-beta5. See them all, or every version of this file.