mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-16 09:32:10 +01:00
language selection in the footer
This commit is contained in:
parent
f957923514
commit
39a0fcd858
2 changed files with 109 additions and 0 deletions
|
|
@ -124,4 +124,94 @@
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Flip-down flip-up */
|
||||||
|
|
||||||
|
.smart-dropdown .selectize-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* When near bottom of viewport, flip up */
|
||||||
|
.flip-up .selectize-dropdown {
|
||||||
|
top: auto !important;
|
||||||
|
bottom: 100% !important;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Text-like select input */
|
||||||
|
.text-select .control-label {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select .form-group.shiny-input-container {
|
||||||
|
height: 24px !important;
|
||||||
|
min-height: 24px !important;
|
||||||
|
max-height: 24px !important;
|
||||||
|
margin: 2px !important;
|
||||||
|
padding: 2px !important;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select .selectize-control {
|
||||||
|
margin: 0;
|
||||||
|
width: 140px !important;
|
||||||
|
padding: 0;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select .selectize-input {
|
||||||
|
border: none !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
width: 100% !important;
|
||||||
|
min-width: auto !important;
|
||||||
|
padding: 0 18px 0 2px !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
height: 1em !important;
|
||||||
|
line-height: 1em !important;
|
||||||
|
font-size: inherit !important;
|
||||||
|
font-family: inherit !important;
|
||||||
|
color: inherit !important;
|
||||||
|
min-height: 1em !important;
|
||||||
|
max-height: 1em !important;
|
||||||
|
display: inline-block !important;
|
||||||
|
vertical-align: top !important;
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select .selectize-input > div {
|
||||||
|
line-height: 1em !important;
|
||||||
|
height: 1em !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
vertical-align: top !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select .selectize-input::after {
|
||||||
|
content: '▼';
|
||||||
|
position: absolute;
|
||||||
|
right: 3px;
|
||||||
|
top: 0;
|
||||||
|
font-size: 0.8em;
|
||||||
|
color: #666;
|
||||||
|
pointer-events: none;
|
||||||
|
line-height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-select .form-group {
|
||||||
|
margin: 0 !important;
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue