mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Fixed URI redirect for normal/expert
This commit is contained in:
@@ -44,11 +44,12 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#admin-mode-toggle input[name=mode-switch]").on('change', function(e){
|
$("#admin-mode-toggle input[name=mode-switch]").on('change', function(e){
|
||||||
var value = $(this).val();
|
var value = $(this).val(),
|
||||||
|
uri = $(this).data('leave-url');
|
||||||
|
|
||||||
if (currentValues == getState()) {
|
if (currentValues == getState()) {
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
window.location.href = '{{ uri.route(true) }}' + ((value == 'expert') ? '/expert:1' : '');
|
window.location.href = uri;
|
||||||
}, 200)
|
}, 200)
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -98,9 +98,9 @@
|
|||||||
{% if context.blueprints.fields %}
|
{% if context.blueprints.fields %}
|
||||||
<form id="admin-mode-toggle">
|
<form id="admin-mode-toggle">
|
||||||
<div class="switch-toggle switch-grav">
|
<div class="switch-toggle switch-grav">
|
||||||
<input type="radio" value="normal" id="normal" name="mode-switch" class="highlight" {% if not uri.param('expert') %} checked="checked"{% endif %}>
|
<input type="radio" value="normal" data-leave-url="{{ uri.route(true) }}" id="normal" name="mode-switch" class="highlight" {% if not uri.param('expert') %} checked="checked"{% endif %}>
|
||||||
<label for="normal">Normal</label>
|
<label for="normal">Normal</label>
|
||||||
<input type="radio" value="expert" id="expert" name="mode-switch" class="highlight" {% if uri.param('expert') %} checked="checked"{% endif %}>
|
<input type="radio" value="expert" data-leave-url="{{ uri.route(true) }}/expert:1" id="expert" name="mode-switch" class="highlight" {% if uri.param('expert') %} checked="checked"{% endif %}>
|
||||||
<label for="expert">Expert</label>
|
<label for="expert">Expert</label>
|
||||||
<a></a>
|
<a></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user