fix popup position flipping
This commit is contained in:
parent
eecbe48695
commit
4d8a31fd54
1 changed files with 5 additions and 2 deletions
|
|
@ -206,9 +206,12 @@ var AcePopup = function(parentNode) {
|
|||
};
|
||||
popup.show = function(pos, lineHeight) {
|
||||
var el = this.container;
|
||||
if (pos.top > window.innerHeight / 2 + lineHeight) {
|
||||
var screenHeight = window.innerHeight;
|
||||
var renderer = this.renderer;
|
||||
var maxH = renderer.$maxLines * lineHeight;
|
||||
if (pos.top +maxH > screenHeight - lineHeight) {
|
||||
el.style.top = "";
|
||||
el.style.bottom = window.innerHeight - pos.top + "px";
|
||||
el.style.bottom = screenHeight - pos.top + "px";
|
||||
} else {
|
||||
pos.top += lineHeight;
|
||||
el.style.top = pos.top + "px";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue