1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Tweak maximum length of drop down menu

This commit is contained in:
Nigel Metheringham 2013-02-24 12:20:16 +00:00
parent 185790e32a
commit 86d55c1c4d
2 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,4 @@
/* Local CSS tweaks for ansible */
.dropdown-menu {
overflow-y: auto;
}

View file

@ -1,6 +1,6 @@
{% extends "basic/layout.html" %}
{% set script_files = script_files + ['_static/bootstrap-dropdown.js', '_static/bootstrap-scrollspy.js'] %}
{% set css_files = ['_static/bootstrap.css', '_static/bootstrap-sphinx.css'] + css_files %}
{% set css_files = ['_static/bootstrap.css', '_static/bootstrap-sphinx.css', '_static/ansible-local.css'] + css_files %}
{# Sidebar: Rework into our Boostrap nav section. #}
{% macro navBar() %}
@ -97,6 +97,20 @@
s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
// Set the maximum height of drop down menus to just less than the height
// of the viewport.
var set_max_menu_height = function () {
// set menu max height to 75 less than viewport height
$('.dropdown-menu').css('max-height', $(window).height() - 75);
}
// Set this when we set the page up and on each resize.
$(window).resize(set_max_menu_height);
$(window).ready(set_max_menu_height);
</script>
{% endblock %}