mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Merge pull request #3038 from jpadilla/dropdown
Set dynamic maximum height for dropdown widgets
This commit is contained in:
commit
5d4bb0ef22
|
@ -151,10 +151,10 @@
|
||||||
<script src="{{ base_url }}/js/theme.js"></script>
|
<script src="{{ base_url }}/js/theme.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//$('.side-nav').scrollspy()
|
|
||||||
var shiftWindow = function() {
|
var shiftWindow = function() {
|
||||||
scrollBy(0, -50)
|
scrollBy(0, -50)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (location.hash) shiftWindow();
|
if (location.hash) shiftWindow();
|
||||||
window.addEventListener("hashchange", shiftWindow);
|
window.addEventListener("hashchange", shiftWindow);
|
||||||
|
|
||||||
|
@ -162,12 +162,12 @@
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Dynamically force sidenav to no higher than browser window
|
// Dynamically force sidenav/dropdown to no higher than browser window
|
||||||
$('.side-nav').css('max-height', window.innerHeight - 130);
|
$('.side-nav, .dropdown-menu').css('max-height', window.innerHeight - 130);
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
$(window).resize(function() {
|
$(window).resize(function() {
|
||||||
$('.side-nav').css('max-height', window.innerHeight - 130);
|
$('.side-nav, .dropdown-menu').css('max-height', window.innerHeight - 130);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,6 +6,7 @@ pre {
|
||||||
|
|
||||||
.dropdown .dropdown-menu {
|
.dropdown .dropdown-menu {
|
||||||
display: none;
|
display: none;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown.open .dropdown-menu {
|
.dropdown.open .dropdown-menu {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user