[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/layouts/js/joomla/form/field/ -> category-change-es5.js (source)

   1  (function () {
   2    'use strict';
   3  
   4    /**
   5     * @copyright  (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
   6     * @license    GNU General Public License version 2 or later; see LICENSE.txt
   7     */
   8    (function (Joomla) {
   9      var id = Joomla.getOptions('category-change');
  10      var element = document.querySelector("#" + id);
  11  
  12      if (!element) {
  13        throw new Error('Category Id element not found');
  14      }
  15  
  16      if (element.getAttribute('data-refresh-catid') && element.value !== element.getAttribute('data-cat-id')) {
  17        element.value = element.getAttribute('data-refresh-catid');
  18      } else {
  19        // No custom fields
  20        element.setAttribute('data-refresh-catid', element.value);
  21      }
  22  
  23      window.Joomla.categoryHasChanged = function (el) {
  24        if (el.value === el.getAttribute('data-refresh-catid')) {
  25          return;
  26        }
  27  
  28        document.body.appendChild(document.createElement('joomla-core-loader')); // Custom Fields
  29  
  30        if (el.getAttribute('data-refresh-section')) {
  31          document.querySelector('input[name=task]').value = el.getAttribute('data-refresh-section') + ".reload";
  32        }
  33  
  34        Joomla.submitform(el.getAttribute('data-refresh-section') + ".reload", element.form);
  35      };
  36    })(Joomla);
  37  
  38  })();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer