mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 13:26:22 -04:00
FIX: Better height estimation / observing for menu panels
This commit is contained in:
parent
d61cfbe2aa
commit
63f0247d21
2 changed files with 2 additions and 3 deletions
|
@ -43,7 +43,6 @@ export default Ember.Component.extend({
|
||||||
$panelBody.height(contentHeight);
|
$panelBody.height(contentHeight);
|
||||||
$('body').addClass('drop-down-visible');
|
$('body').addClass('drop-down-visible');
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const menuTop = headerHeight();
|
const menuTop = headerHeight();
|
||||||
|
|
||||||
let height;
|
let height;
|
||||||
|
@ -127,7 +126,7 @@ export default Ember.Component.extend({
|
||||||
_watchSizeChanges() {
|
_watchSizeChanges() {
|
||||||
if (mutationSupport) {
|
if (mutationSupport) {
|
||||||
this._observer.disconnect();
|
this._observer.disconnect();
|
||||||
this._observer.observe(this.element, { childList: true, subtree: true });
|
this._observer.observe(this.element, { childList: true, subtree: true, attributes: true });
|
||||||
} else {
|
} else {
|
||||||
clearInterval(this._resizeInterval);
|
clearInterval(this._resizeInterval);
|
||||||
this._resizeInterval = setInterval(() => {
|
this._resizeInterval = setInterval(() => {
|
||||||
|
|
|
@ -45,7 +45,7 @@ export default Ember.Component.extend({
|
||||||
if (this.get('loadingNotifications')) { return; }
|
if (this.get('loadingNotifications')) { return; }
|
||||||
|
|
||||||
// estimate (poorly) the amount of notifications to return
|
// estimate (poorly) the amount of notifications to return
|
||||||
var limit = Math.round(($(window).height() - headerHeight()) / 50);
|
var limit = Math.round(($(window).height() - headerHeight()) / 55);
|
||||||
// we REALLY don't want to be asking for negative counts of notifications
|
// we REALLY don't want to be asking for negative counts of notifications
|
||||||
// less than 5 is also not that useful
|
// less than 5 is also not that useful
|
||||||
if (limit < 5) { limit = 5; }
|
if (limit < 5) { limit = 5; }
|
||||||
|
|
Loading…
Reference in a new issue