CoreFiles by mySites.guru
admin-field-changecontext.js13 lines, 484 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
f309ac18b01deb24eaafde506d9956e4
sha1
c5103ff6156315734567bf19c4f80c831d82cd52
sha256
f731bd5a4d942363eebc9a1b90f2b362689d0a9dd960ed9569f6522b658b135c
/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

Joomla.fieldsChangeContext = context => {

  const regex = /([?;&])context[^&;]*[;&]?/;
  const url = window.location.href;
  const query = url.replace(regex, '$1').replace(/&$/, '');
  // eslint-disable-next-line
  window.location.href = (query.length > 2 ? query + '&' : '?') + (context ? 'context=' + context : '');
};

The same content is in 59 releases, Joomla 5.1.0-beta2 to 6.0.0-alpha3. See them all, or every version of this file.