CoreFiles by mySites.guru
admin-module-edit_assignment.es6.js39 lines, 1,036 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
2fb27e9f06ad85ea0623f574b376f4e3
sha1
991afa7d96c2091112561eedf2b95ade18f95d84
sha256
17d12bf4ead46fb8c8619e03817995243bad182b355a432891e6fbffb6d9fa4b
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(() => {
  'use strict';

  const onChange = value => {
    if (value === '-' || parseInt(value, 10) === 0) {
      document.getElementById('menuselect-group').classList.add('hidden');
    } else {
      document.getElementById('menuselect-group').classList.remove('hidden');
    }
  };

  const onBoot = () => {
    const element = document.getElementById('jform_assignment');

    if (element) {
      // Initialise the state
      onChange(element.value); // Check for changes in the state

      element.addEventListener('change', ({
        target
      }) => {
        onChange(target.value);
      });
    }

    document.removeEventListener('DOMContentLoaded', onBoot);
  };

  document.addEventListener('DOMContentLoaded', onBoot);
})();

The same content is in 2 releases, Joomla 4.0.0-beta6 to 4.0.0-beta7. See them all, or every version of this file.