FIX: component height computation was wrong

This commit is contained in:
Joffrey JAFFEUX 2017-09-07 16:55:36 +02:00 committed by GitHub
parent 0ce9098339
commit d04aa5c7af
1 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ export default Ember.Component.extend({
let options = { left: "auto", bottom: "auto", left: "auto", top: "auto" };
const headerHeight = this.$(".select-box-header").outerHeight(false);
const filterHeight = this.$(".select-box-filter").outerHeight(false);
const collectionHeight = this.$(".select-box-collection").outerHeight(false);
const bodyHeight = this.$(".select-box-body").outerHeight(false);
const windowWidth = $(window).width();
const windowHeight = $(window).height();
const boundingRect = this.$()[0].getBoundingClientRect();
@ -116,7 +116,7 @@ export default Ember.Component.extend({
}
}
const componentHeight = this.get("verticalOffset") + collectionHeight + filterHeight + headerHeight;
const componentHeight = this.get("verticalOffset") + bodyHeight + headerHeight;
const hasBelowSpace = windowHeight - offsetTop - componentHeight > 0;
if (hasBelowSpace) {
this.$().addClass("is-below");