CoreFiles by mySites.guru
config-filters-es5.js34 lines, 1,312 bytes, from Joomla_4.3.0-Stable-Full_Package.zip
Raw History Compare with 4.2.9
md5
96e850c0eb28cacdf3e5dba172fe2ffe
sha1
eea76c33996a0ef2a2a4752eae706366cdb18756
sha256
13fad5819bdeb15690b9bc97c30653d3201582c99955251c8d3b2d0ec20d5958
(function () {
  'use strict';

  /**
   * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   */
  var recursiveApplyChanges = function recursiveApplyChanges(id) {
    var childs = [].slice.call(document.querySelectorAll("#filter-config select[data-parent=\"" + id + "\"]"));
    childs.map(function (child) {
      recursiveApplyChanges(child.dataset.id);
      child.value = 'NONE';
      return child;
    });
  };
  var applyChanges = function applyChanges(event) {
    var currentElement = event.currentTarget;
    var currentFilter = currentElement.options[currentElement.selectedIndex].value;
    if (currentFilter === 'NONE') {
      var childs = [].slice.call(document.querySelectorAll("#filter-config select[data-parent=\"" + currentElement.dataset.id + "\"]"));
      if (childs.length && window.confirm(Joomla.Text._('COM_CONFIG_TEXT_FILTERS_NOTE'))) {
        childs.map(function (child) {
          recursiveApplyChanges(child.dataset.id);
          child.value = 'NONE';
          return child;
        });
      }
    }
  };
  [].slice.call(document.querySelectorAll('#filter-config select')).map(function (select) {
    return select.addEventListener('change', applyChanges);
  });

})();

The same content is in 57 releases, Joomla 4.3.0-alpha1 to 5.0.0-alpha1. See them all, or every version of this file.