mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-06 12:43:06 +08:00
Add const to dropdown library
This commit is contained in:
parent
309f8c1a3d
commit
af4ac7c53b
1 changed files with 3 additions and 2 deletions
|
@ -62,8 +62,9 @@ var dropdownSelector = (function() {
|
|||
var modalContainer = container.closest('.modal-dialog');
|
||||
var modalContainerBottom = 0;
|
||||
var maxHeight = 0;
|
||||
const bottomTreshold = 280;
|
||||
|
||||
if (modalContainer.length && windowHeight - modalContainer.height() > 100) {
|
||||
if (modalContainer.length && windowHeight - modalContainer.height() > bottomTreshold) {
|
||||
let modalClientRect = modalContainer[0].getBoundingClientRect();
|
||||
windowHeight = modalContainer.height() + modalClientRect.top;
|
||||
containerPositionLeft -= modalClientRect.left;
|
||||
|
@ -72,7 +73,7 @@ var dropdownSelector = (function() {
|
|||
}
|
||||
bottomSpace = windowHeight - containerPosition - containerHeight;
|
||||
|
||||
if ((modalContainerBottom + bottomSpace) < 280) {
|
||||
if ((modalContainerBottom + bottomSpace) < bottomTreshold) {
|
||||
container.addClass('inverse');
|
||||
container.find('.dropdown-container').css('max-height', `${(containerPosition - 122 + maxHeight)}px`)
|
||||
.css('margin-bottom', `${(containerPosition * -1)}px`)
|
||||
|
|
Loading…
Reference in a new issue