CoreFiles by mySites.guru
two-factor-switcher.es6.js25 lines, 789 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
b73260e0df9a0b0e3600e9a18ea53bca
sha1
54d5b92656cd885cb21dc23292a52a8720da011e
sha256
65d05313e40954255827a95a241d8098c3edcfaf614d1f3dcc07107f087758a9
/**
 * @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 || {};

((Joomla) => {
  'use strict';

  document.addEventListener('DOMContentLoaded', () => {
    Joomla.twoFactorMethodChange = () => {
      const selectedPane = `com_users_twofactor_${document.getElementById('jform_twofactor_method').value}`;

      [].slice.call(document.querySelectorAll('#com_users_twofactor_forms_container>div')).forEach((el) => {
        if (el.id !== selectedPane) {
          document.getElementById(el.id).style.display = 'none';
          return;
        }

        document.getElementById(el.id).style.display = 'block';
      });
    };
  });
})(Joomla);

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