CoreFiles by mySites.guru
admin-field-changecontext.es6.js14 lines, 477 bytes, from Joomla_4.0.0-beta7-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta6
md5
4eeec30b22ad16b5adacbc179debb794
sha1
20664de50171821be6c38096ff2020e34ec2d346
sha256
1553938de0d018cf1fe610464165f1b2037f8d60b3586f1708b1487c6dd6a628
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

Joomla.fieldsChangeContext = context => {
  'use strict';

  const regex = new RegExp('([?;&])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 8 releases, Joomla 4.0.0-alpha12 to 4.0.0-beta7. See them all, or every version of this file.