Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla5/media/com_fields/js/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla5/media/com_fields/js/admin-field-changecontext.js

/**
 * @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 : '');
};