url param for routing options

pass JSON-encoded routing options in the url param `routing_opts`, they are passed along verbatim as an override
This commit is contained in:
Gwendolyn 2024-12-16 20:35:14 +01:00
parent 55b90f235c
commit b9c1695463

View file

@ -792,7 +792,15 @@ c3nav = {
c3nav._maybe_load_site_update(e.state); c3nav._maybe_load_site_update(e.state);
}, },
load_state: function (state, nofly) { load_state: function (state, nofly) {
console.log(window.location); const route_options_str = new URLSearchParams(window.location.search).get('route_opts');
if (route_options_str) {
try {
c3nav.next_route_options = JSON.parse(route_options_str);
} catch (e) {
console.error(e);
}
}
if (state.modal) { if (state.modal) {
history.back(); history.back();
return; return;