mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
#94 fixed dropdown menu placement in small window
This commit is contained in:
parent
1e4c108f6f
commit
c30724c5da
@ -16,9 +16,17 @@
|
|||||||
|
|
||||||
if (offset.left + width > window.innerWidth) {
|
if (offset.left + width > window.innerWidth) {
|
||||||
newLeft = offset.left - width;
|
newLeft = offset.left - width;
|
||||||
|
|
||||||
|
if (newLeft < 0) newLeft = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (offset.top + height > window.innerHeight) {
|
if (offset.top + height > window.innerHeight) {
|
||||||
newTop = offset.top - height;
|
newTop = offset.top - height;
|
||||||
|
|
||||||
|
if (newTop < 0) newTop = 0;
|
||||||
|
if (newTop + height > window.innerHeight) {
|
||||||
|
element.style.height = `${window.innerHeight - newTop}px`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newLeft != null) element.style.left = `${newLeft}px`;
|
if (newLeft != null) element.style.left = `${newLeft}px`;
|
||||||
@ -115,6 +123,7 @@
|
|||||||
z-index: 1050;
|
z-index: 1050;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.keyText {
|
.keyText {
|
||||||
|
Loading…
Reference in New Issue
Block a user