CoreFiles by mySites.guru
admin-language-edit-change-flag.js24 lines, 944 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
388f3292e6e798544def1bd22b51238b
sha1
c2d4eaada073f0c563b74e751a0def6498a4f7fb
sha256
6c35890b8017b7bc86d90efc8bfdd38d486ff5c472b96fca096a3a2d89e58e16
/**
* 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
 */
document.addEventListener('DOMContentLoaded', function () {
  document.getElementById('jform_image').addEventListener('change', function (event) {
    var flagSelectedValue = event.currentTarget.value;
    var flagimage = document.getElementById('flag').querySelector('img');
    var src = Joomla.getOptions('system.paths').rootFull + '/media/mod_languages/images/' + flagSelectedValue + '.gif';

    if (flagSelectedValue) {
      flagimage.setAttribute('src', src);
      flagimage.setAttribute('alt', flagSelectedValue);
    } else {
      flagimage.removeAttribute('src');
      flagimage.setAttribute('alt', '');
    }
  }, false);
});

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