CoreFiles by mySites.guru
admin-banner-edit.js47 lines, 1,271 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
ae2575ef66f63368382bbce8aa138866
sha1
9cc77a9696eacf3508e62e9395d627182a0f54af
sha256
7bf8acc436261c19ffdd10a4e2689de1a42440bea3b919e0212b8001075652e7
/**
* 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
 */
(function (document) {
  'use strict';

  var updateBannerFields = function updateBannerFields(value) {
    var imgWrapper = document.getElementById('image');
    var custom = document.getElementById('custom');

    switch (value) {
      case '0':
        // Image
        imgWrapper.style.display = 'block';
        custom.style.display = 'none';
        break;

      case '1':
        // Custom
        imgWrapper.style.display = 'none';
        custom.style.display = 'block';
        break;

      default: // Do nothing

    }
  };

  document.addEventListener('DOMContentLoaded', function () {
    var jformType = document.getElementById('jform_type');

    if (jformType) {
      // Hide/show parameters initially
      updateBannerFields(jformType.value); // Hide/show parameters when the type has been selected

      jformType.addEventListener('change', function (event) {
        updateBannerFields(event.target.value);
      });
    }
  });
})(document);

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