mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-28 04:24:00 +03:00
fix: fix scroll to headings & remove unnecessary scripts
This commit is contained in:
parent
a10a198aae
commit
8b2d4a881e
|
@ -198,33 +198,5 @@
|
|||
{% for path in config.extra_javascript %}
|
||||
<script src="{{ path|url }}" defer></script>
|
||||
{% endfor %}
|
||||
|
||||
<script>
|
||||
var shiftWindow = function () {
|
||||
scrollBy(0, -50);
|
||||
};
|
||||
|
||||
if (location.hash) shiftWindow();
|
||||
window.addEventListener("hashchange", shiftWindow);
|
||||
|
||||
$(".dropdown-menu").on("click touchstart", function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
// Dynamically force sidenav/dropdown to no higher than browser window
|
||||
$(".side-nav, .dropdown-menu").css(
|
||||
"max-height",
|
||||
window.innerHeight - 130
|
||||
);
|
||||
|
||||
$(function () {
|
||||
$(window).resize(function () {
|
||||
$(".side-nav, .dropdown-menu").css(
|
||||
"max-height",
|
||||
window.innerHeight - 130
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -13,7 +13,4 @@ import "../../node_modules/bootstrap/js/dist/tooltip";
|
|||
|
||||
import "../scss/styles.scss";
|
||||
|
||||
const codeBlocks = document.querySelectorAll("pre code");
|
||||
codeBlocks.forEach((block) => {
|
||||
block.parentElement.classList.add(["prettyprint", "well"]);
|
||||
});
|
||||
setupPrettify();
|
||||
|
|
|
@ -105,7 +105,7 @@ pre code {
|
|||
}
|
||||
|
||||
.body-content {
|
||||
padding-top: 120px;
|
||||
padding-top: 70px;
|
||||
padding-bottom: 70px;
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,7 @@ pre code {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: end;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.toclink {
|
||||
|
@ -153,7 +154,7 @@ pre code {
|
|||
}
|
||||
|
||||
.prettyprint {
|
||||
padding: 8px;
|
||||
padding: 20px;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@ watch:
|
|||
markdown_extensions:
|
||||
- admonition
|
||||
- toc:
|
||||
anchorlink: True
|
||||
# anchorlink: True
|
||||
permalink: True
|
||||
|
||||
nav:
|
||||
- Home: 'index.md'
|
||||
|
|
Loading…
Reference in New Issue
Block a user