fix: littleweb browser page url bar
This commit is contained in:
parent
e72ccf9139
commit
22a2545aa0
1 changed files with 10 additions and 2 deletions
|
@ -148,7 +148,13 @@
|
|||
if (data.event === \"change_url\") {
|
||||
const uri = new URL(data.target).pathname.slice(\"/api/v1/net/\".length);
|
||||
window.history.pushState(null, null, `/net/${uri.replace(\"atto://\", \"\")}`);
|
||||
document.getElementById(\"uri\").setAttribute(\"true_value\", `atto://${uri}`);
|
||||
|
||||
if (!uri.includes(\"atto://\")) {
|
||||
document.getElementById(\"uri\").setAttribute(\"true_value\", `atto://${uri}`);
|
||||
} else {
|
||||
document.getElementById(\"uri\").setAttribute(\"true_value\", uri);
|
||||
}
|
||||
|
||||
document.getElementById(\"uri\").value = uri.split(\"/\")[0];
|
||||
}
|
||||
});
|
||||
|
@ -205,6 +211,8 @@
|
|||
});
|
||||
|
||||
// navigate
|
||||
littleweb_navigate(\"{{ path|safe }}\");"))
|
||||
if ({{ path|length }} > 0) {
|
||||
littleweb_navigate(\"{{ path|safe }}\");
|
||||
}"))
|
||||
|
||||
(text "{% endblock %}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue