mirror of
https://github.com/zensical/zensical.git
synced 2026-09-23 06:45:36 +00:00
fix: changes to extra_css not automatically reloaded (#328)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
@@ -51,14 +51,11 @@ static CLIENT: &str = concat!(
|
||||
" pending(true);\n",
|
||||
" socket.addEventListener(\"message\", ev => {\n",
|
||||
" if (ev.data.endsWith(\".css\")) {\n",
|
||||
" const file = ev.data.split(\"/\").pop();\n",
|
||||
" document.querySelectorAll(`link[rel=\"stylesheet\"]`)",
|
||||
" .forEach(link => {\n",
|
||||
" if (link.href.includes(file)) {\n",
|
||||
" const reload = link.cloneNode(true);\n",
|
||||
" reload.addEventListener(\"load\", () => {\n",
|
||||
" link.parentNode.removeChild(link)\n",
|
||||
" })\n",
|
||||
" if (link.href.includes(ev.data)) {\n",
|
||||
" const href = link.href.split(\"?\")[0]\n",
|
||||
" link.href = href + \"?t=\" + new Date().getTime();\n",
|
||||
" }\n",
|
||||
" });\n",
|
||||
" return\n",
|
||||
|
||||
Reference in New Issue
Block a user