mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 18:23:37 +08:00
FIX: Custom header sizes and scrolling with menu panels
This commit is contained in:
parent
e5911e7fc4
commit
989c915a02
|
@ -39,7 +39,8 @@ export default Ember.Component.extend({
|
||||||
$panelBody.height(contentHeight);
|
$panelBody.height(contentHeight);
|
||||||
} else {
|
} else {
|
||||||
$panelBody.height('auto');
|
$panelBody.height('auto');
|
||||||
const headerHeight = parseInt($('header.d-header').height() + 3);
|
const $header = $('header.d-header');
|
||||||
|
const headerHeight = parseInt($header.height() + $header.offset().top - $(window).scrollTop() + 3);
|
||||||
this.$().css({ left: "auto", top: headerHeight + "px" });
|
this.$().css({ left: "auto", top: headerHeight + "px" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -69,9 +70,11 @@ export default Ember.Component.extend({
|
||||||
});
|
});
|
||||||
this.performLayout();
|
this.performLayout();
|
||||||
this._watchSizeChanges();
|
this._watchSizeChanges();
|
||||||
|
$(window).on('scroll.discourse-menu-panel', () => this.performLayout());
|
||||||
} else {
|
} else {
|
||||||
Ember.run.scheduleOnce('afterRender', () => this.sendAction('onHidden'));
|
Ember.run.scheduleOnce('afterRender', () => this.sendAction('onHidden'));
|
||||||
$('html').off('click.close-menu-panel');
|
$('html').off('click.close-menu-panel');
|
||||||
|
$(window).off('scroll.discourse-menu-panel');
|
||||||
this._stopWatchingSize();
|
this._stopWatchingSize();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -162,6 +165,7 @@ export default Ember.Component.extend({
|
||||||
$('body').off('keydown.discourse-menu-panel');
|
$('body').off('keydown.discourse-menu-panel');
|
||||||
$('html').off('click.close-menu-panel');
|
$('html').off('click.close-menu-panel');
|
||||||
$(window).off('resize.discourse-menu-panel');
|
$(window).off('resize.discourse-menu-panel');
|
||||||
|
$(window).off('scroll.discourse-menu-panel');
|
||||||
},
|
},
|
||||||
|
|
||||||
hide() {
|
hide() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user