language selection in the footer

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-09-23 12:25:08 +02:00
commit 39a0fcd858
No known key found for this signature in database
2 changed files with 109 additions and 0 deletions

View file

@ -72,3 +72,22 @@ $(document).on('shiny:sessioninitialized', function() {
});
// Flip-down flip-up
$(document).on('focus', '.smart-dropdown .selectize-control input', function() {
var $dropdown = $(this).closest('.selectize-control').find('.selectize-dropdown');
var $container = $(this).closest('.smart-dropdown');
var containerBottom = $container.offset().top + $container.outerHeight();
var windowHeight = $(window).height();
var scrollTop = $(window).scrollTop();
var viewportBottom = scrollTop + windowHeight;
// If there's not enough space below, flip up
if (containerBottom + 200 > viewportBottom) {
$container.addClass('flip-up');
} else {
$container.removeClass('flip-up');
}
});