mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-28 04:24:00 +03:00
fix: move scripts to end of page
This commit is contained in:
parent
4f7f4ab054
commit
fb6210066f
|
@ -127,53 +127,7 @@
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- Le javascript
|
<!-- Search Modal Start -->
|
||||||
================================================== -->
|
|
||||||
<!-- Placed at the end of the document so the pages load faster -->
|
|
||||||
<!-- <script async src="https://fund.django-rest-framework.org/sidebar_include.js"></script>
|
|
||||||
<script src="{{ 'js/jquery-1.8.1-min.js'|url }}"></script>
|
|
||||||
<script src="{{ 'js/prettify-1.0.js'|url }}"></script>
|
|
||||||
<script src="{{ 'js/bootstrap-2.1.1-min.js'|url }}"></script>
|
|
||||||
<script src="{{ 'js/theme.js'|url }}"></script> -->
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var base_url = "{{ base_url }}";
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script src="{{ 'js/bootstrap5.bundle.js'|url }}"></script>
|
|
||||||
|
|
||||||
{% 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>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="modal fade"
|
class="modal fade"
|
||||||
id="mkdocs_search_modal"
|
id="mkdocs_search_modal"
|
||||||
|
@ -224,5 +178,52 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal End -->
|
<!-- Modal End -->
|
||||||
|
|
||||||
|
<!-- Le javascript
|
||||||
|
================================================== -->
|
||||||
|
<!-- Placed at the end of the document so the pages load faster -->
|
||||||
|
<!-- <script async src="https://fund.django-rest-framework.org/sidebar_include.js"></script>
|
||||||
|
<script src="{{ 'js/jquery-1.8.1-min.js'|url }}"></script>
|
||||||
|
<script src="{{ 'js/prettify-1.0.js'|url }}"></script>
|
||||||
|
<script src="{{ 'js/bootstrap-2.1.1-min.js'|url }}"></script>
|
||||||
|
<script src="{{ 'js/theme.js'|url }}"></script> -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var base_url = "{{ base_url }}";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="{{ 'js/bootstrap5.bundle.js'|url }}"></script>
|
||||||
|
|
||||||
|
{% 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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user