CoreFiles by mySites.guru
two-factor-switcher.es6.js36 lines, 1,074 bytes, from Joomla_4.0.0-beta6-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta5
md5
145401e3e0c9934f4a103fd41eb8ab92
sha1
36e483f867c22e5555c6359c8365440248f30727
sha256
9ca9b0b03341c2fcd271020f6d9f4ec7aa3bc678fec96aa0be19ba1ce25aec19
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
Joomla = window.Joomla || {};

(Joomla => {
  'use strict';

  document.addEventListener('DOMContentLoaded', () => {
    Joomla.twoFactorMethodChange = () => {
      const method = document.getElementById('jform_twofactor_method');

      if (method) {
        const selectedPane = `com_users_twofactor_${method.value}`;
        const twoFactorForms = [].slice.call(document.querySelectorAll('#com_users_twofactor_forms_container > div'));
        twoFactorForms.forEach(value => {
          const {
            id
          } = value;

          if (id !== selectedPane) {
            document.getElementById(id).classList.add('hidden');
          } else {
            document.getElementById(id).classList.remove('hidden');
          }
        });
      }
    };
  });
})(Joomla);

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