CoreFiles by mySites.guru
admin-users-groups.js34 lines, 1,034 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
166b51562eedd64372ac60f3ff90b357
sha1
2cc9f4872f35b32ec3454270a3f3ff2ee6687a25
sha256
264860e8ac4568567125c983acb95d62319400c0428f8f0691621180bf0ced37
/**
* 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 - 2018 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);

No other release has this exact content. See every version of this file.