mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-04 09:57:55 +03:00 
			
		
		
		
	fix: move scripts to end of page
This commit is contained in:
		
							parent
							
								
									4f7f4ab054
								
							
						
					
					
						commit
						fb6210066f
					
				| 
						 | 
				
			
			@ -127,53 +127,7 @@
 | 
			
		|||
      </p>
 | 
			
		||||
    </footer>
 | 
			
		||||
 | 
			
		||||
    <!-- 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>
 | 
			
		||||
 | 
			
		||||
    <!-- Search Modal Start -->
 | 
			
		||||
    <div
 | 
			
		||||
      class="modal fade"
 | 
			
		||||
      id="mkdocs_search_modal"
 | 
			
		||||
| 
						 | 
				
			
			@ -224,5 +178,52 @@
 | 
			
		|||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <!-- 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>
 | 
			
		||||
</html>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user