CoreFiles by mySites.guru
admin-users-groups.js36 lines, 1,035 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
d1e511a2101317b15a551da4c42ec80d
sha1
0829a25bd7c50e88e4d14712e7c42683a7a0e9fd
sha256
717a14ae35aca065f0d00293605b0d4ad90a9be11d069190f113472011072b07
/**
* 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.