CoreFiles by mySites.guru
admin-users-groups.es6.js36 lines, 1,015 bytes, from Joomla_4.0.0-alpha12-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha11
md5
02e95f036eda5193510d0c167ec90a35
sha1
251580312df7c14bf3c6fd06cd0dbcc68aff831b
sha256
1b354ee0fd4c72002b4bfd0cbe89b0b5c3d77f574471c275e69e1b7e58fed3b8
/**
* 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 - 2019 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 6 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha12. See them all, or every version of this file.