mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
Fix undefined $scrollParent
This commit is contained in:
committed by
Franz Liedke
parent
94d3bea53e
commit
8cc9e18990
@@ -99,6 +99,7 @@ export default class NotificationList extends Component {
|
||||
|
||||
const $notifications = this.$('.NotificationList-content');
|
||||
const $scrollParent = $notifications.css('overflow') === 'auto' ? $notifications : $(window);
|
||||
|
||||
$scrollParent.on('scroll', this.scrollHandler.bind(this));
|
||||
}
|
||||
|
||||
@@ -111,12 +112,13 @@ export default class NotificationList extends Component {
|
||||
|
||||
scrollHandler() {
|
||||
const state = this.attrs.state;
|
||||
const scrollTop = $scrollParent.scrollTop();
|
||||
const viewportHeight = $scrollParent.height();
|
||||
|
||||
const $notifications = this.$('.NotificationList-content');
|
||||
const $scrollParent = $notifications.css('overflow') === 'auto' ? $notifications : $(window);
|
||||
|
||||
const scrollTop = $scrollParent.scrollTop();
|
||||
const viewportHeight = $scrollParent.height();
|
||||
|
||||
const contentTop = $scrollParent === $notifications ? 0 : $notifications.offset().top;
|
||||
const contentHeight = $notifications[0].scrollHeight;
|
||||
|
||||
|
Reference in New Issue
Block a user