mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-12-27 21:11:09 +00:00
update theme on change in config admin page
This commit is contained in:
parent
98b7e33288
commit
b8b6dda131
|
@ -11,7 +11,7 @@
|
|||
%title << {{config.name}}: {{page}}
|
||||
%meta(charset="UTF-8")
|
||||
%meta(name="viewport" content="width=device-width, initial-scale=1")
|
||||
%link(rel="stylesheet" type="text/css" href="/theme/{{config.theme}}.css" nonce="{{view.request['hash']}}")
|
||||
%link(rel="stylesheet" type="text/css" href="/theme/{{config.theme}}.css" nonce="{{view.request['hash']}}" class="theme")
|
||||
%link(rel="stylesheet" type="text/css" href="/static/style.css" nonce="{{view.request['hash']}}")
|
||||
%link(rel="stylesheet" type="text/css" href="/static/toast.css" nonce="{{view.request['hash']}}")
|
||||
%script(type="application/javascript" src="/static/menu.js" nonce="{{view.request['hash']}}", defer)
|
||||
|
|
|
@ -27,6 +27,10 @@ async function handle_config_change(event) {
|
|||
document.querySelector("title").innerHTML = params.value;
|
||||
}
|
||||
|
||||
if (params.key === "theme") {
|
||||
document.querySelector("link.theme").href = `/theme/${params.value}.css`;
|
||||
}
|
||||
|
||||
toast("Updated config", "message");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue