first commit
This commit is contained in:
8
media/com_fields/js/admin-field-changecontext.js
Normal file
8
media/com_fields/js/admin-field-changecontext.js
Normal file
@ -0,0 +1,8 @@
|
||||
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 : '');
|
||||
};
|
||||
Reference in New Issue
Block a user