CoreFiles by mySites.guru
admin-banner-edit.js47 lines, 1,282 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
d265c986ae08c71e9e04d934e22d1fb1
sha1
f14ace2bc3ebccee2750e8a5fb1f34a60a908f62
sha256
88720827e00651a4c8f4c6d77963fa2874906afa5568188aa3e877b530b27f2c
/**
* 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.