CoreFiles by mySites.guru
admin-language-edit-change-flag.es6.js24 lines, 930 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
81c2faf4cb8e49a1bf7e5386527c8b17
sha1
1034e6420065f02640db2d154fd241ac76d834c6
sha256
65c331d038573406bc606049ef275901fe56629fec3e0be1519ec9397d28cb0c
/**
* 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 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
document.addEventListener('DOMContentLoaded', () => {
  document.getElementById('jform_image').addEventListener('change', event => {
    const flagSelectedValue = event.currentTarget.value;
    const flagimage = document.getElementById('flag').querySelector('img');
    const 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.