CoreFiles by mySites.guru
finder-edit.js57 lines, 1,938 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
6973c88e3dcac960ef1bfbe9f6c0658e
sha1
6364e585ccfac3017da46e72141245846bfe7cf5
sha256
df5e835f555bece4c6fd6a85441e1ccdc4cef643f203c61523fea95ada484490
/**
* 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 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
Joomla = window.Joomla || {};

(function () {
  'use strict';

  document.addEventListener('DOMContentLoaded', function () {
    // Handle toggle all
    [].slice.call(document.querySelectorAll('.filter-toggle-all')).forEach(function (button) {
      button.addEventListener('click', function () {
        [].slice.call(document.querySelectorAll('.filter-node')).forEach(function (node) {
          node.click();
        });
      });
    }); // Update the count

    [].slice.call(document.querySelectorAll('.filter-node')).forEach(function () {
      var count = document.getElementById('jform_map_count');

      if (count) {
        count.value = document.querySelectorAll('input[type="checkbox"]:checked').length;
      }
    }); // Expand/collapse

    var expandAccordion = document.getElementById('expandAccordion');

    if (expandAccordion) {
      expandAccordion.addEventListener('click', function (event) {
        event.preventDefault();
        var elements;

        if (event.target.innerText === Joomla.JText._('COM_FINDER_FILTER_SHOW_ALL')) {
          event.target.innerText = Joomla.JText._('COM_FINDER_FILTER_HIDE_ALL');
          elements = [].slice.call(document.querySelectorAll('.collapse:not(.show)'));
        } else {
          event.target.innerText = Joomla.JText._('COM_FINDER_FILTER_SHOW_ALL');
          elements = [].slice.call(document.querySelectorAll('.collapse.show'));
        }

        if (elements) {
          elements.forEach(function (element) {
            // @todo Remove jQuery!!
            window.jQuery(element).collapse('toggle');
          });
        }
      });
    }
  });
})();

No other release has this exact content. See every version of this file.