CoreFiles by mySites.guru
finder-edit.js67 lines, 2,166 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
2bb4a3c5b439443fc2e18faecc8160cd
sha1
f003d729eccdb0d4735032f9b1f76418144c69d6
sha256
4e7325cb47faec1ab992bad00d1b4504ac775f564a7bb0e134cb379c71a0b1a1
/**
* 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 - 2018 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 = void 0;

        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(.in)'));

          if (elements) {
            elements.forEach(function (element) {
              // @todo Remove jQuery!!
              window.jQuery(element).collapse('toggle');
            });
          }
        } else {
          event.target.innerText = Joomla.JText._('COM_FINDER_FILTER_SHOW_ALL');

          elements = [].slice.call(document.querySelectorAll('.collapse.in'));

          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.