UX: Take into account of header when rendering autocomplete.
This commit is contained in:
parent
b5d6d3c326
commit
5d2aa957b4
|
@ -237,16 +237,20 @@ export default function(options) {
|
||||||
|
|
||||||
me.parent().append(div);
|
me.parent().append(div);
|
||||||
|
|
||||||
if(!isInput){
|
if (!isInput) {
|
||||||
vOffset = div.height();
|
vOffset = div.height();
|
||||||
|
|
||||||
|
if ((window.innerHeight - me.outerHeight() - $("header.d-header").innerHeight()) < vOffset) {
|
||||||
|
vOffset = -23;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Discourse.Site.currentProp('mobileView') && !isInput) {
|
if (Discourse.Site.currentProp('mobileView')) {
|
||||||
div.css('width', 'auto');
|
div.css('width', 'auto');
|
||||||
|
|
||||||
if ((me.height() / 2) >= pos.top) { vOffset = -23; }
|
if ((me.height() / 2) >= pos.top) { vOffset = -23; }
|
||||||
if ((me.width() / 2) <= pos.left) { hOffset = -div.width(); }
|
if ((me.width() / 2) <= pos.left) { hOffset = -div.width(); }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var mePos = me.position();
|
var mePos = me.position();
|
||||||
var borderTop = parseInt(me.css('border-top-width'), 10) || 0;
|
var borderTop = parseInt(me.css('border-top-width'), 10) || 0;
|
||||||
|
|
Loading…
Reference in New Issue