Move mobile topbar title creation entirely into JS
This commit is contained in:
parent
078eb1120a
commit
354397f04d
@ -49,10 +49,12 @@ window.currentCrate = getVar("current-crate");
|
||||
function setMobileTopbar() {
|
||||
// FIXME: It would be nicer to generate this text content directly in HTML,
|
||||
// but with the current code it's hard to get the right information in the right place.
|
||||
const mobileLocationTitle = document.querySelector(".mobile-topbar h2");
|
||||
const mobileTopbar = document.querySelector(".mobile-topbar");
|
||||
const locationTitle = document.querySelector(".sidebar h2.location");
|
||||
if (mobileLocationTitle && locationTitle) {
|
||||
mobileLocationTitle.innerHTML = locationTitle.innerHTML;
|
||||
if (mobileTopbar && locationTitle) {
|
||||
const mobileTitle = document.createElement("h2");
|
||||
mobileTitle.innerHTML = locationTitle.innerHTML;
|
||||
mobileTopbar.appendChild(mobileTitle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,8 +84,7 @@
|
||||
<img class="rust-logo" src="{{static_root_path|safe}}{{files.rust_logo_svg}}" alt="logo"> {# #}
|
||||
{% endif %}
|
||||
</a> {# #}
|
||||
<h2></h2> {# #}
|
||||
</nav> {# #}
|
||||
</nav>
|
||||
{% endif %}
|
||||
<nav class="sidebar"> {# #}
|
||||
{% if page.css_class != "src" %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user