CoreFiles by mySites.guru
two-factor-switcher-es5.js32 lines, 1,013 bytes, from Joomla_4.1.2-Stable-Full_Package.zip
Raw History Compare with 4.1.1
md5
7ef9edc8adf70f1be89df925045dc9ba
sha1
b4c5251cef04ca4e885882810dc7a3ee15220633
sha256
9738b58c25f8353ea86fd2dcafaaaeafe1c6b8c0771b907a6646d00d39811983
(function () {
  'use strict';

  /**
   * @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 || {};

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

        if (method) {
          var selectedPane = "com_users_twofactor_" + method.value;
          var twoFactorForms = [].slice.call(document.querySelectorAll('#com_users_twofactor_forms_container > div'));
          twoFactorForms.forEach(function (value) {
            var id = value.id;

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

})();

The same content is in 24 releases, Joomla 4.0.6-rc1 to 4.2.0-alpha3. See them all, or every version of this file.