Added idea messagelist infinite scroll

This commit is contained in:
the-djmaze 2022-11-22 13:20:18 +01:00
parent bf6b30c971
commit c2b4b1f238
2 changed files with 23 additions and 3 deletions

View file

@ -254,10 +254,11 @@ export class MailMessageList extends AbstractViewRight {
}
});
/*
MessagelistUserStore.endHash.subscribe((() =>
this.selector.scrollToFocused()
).throttle(50));
*/
decorateKoCommands(this, {
downloadCommand: canBeMovedHelper,
forwardCommand: canBeMovedHelper,
@ -535,6 +536,21 @@ export class MailMessageList extends AbstractViewRight {
}
});
b_content.addEventListener(
'scroll',
(() => {
if (b_content.scrollTop >= (b_content.scrollTopMax || (b_content.scrollHeight - b_content.clientTop))) {
// Load more messages in the MessageList
let page = MessagelistUserStore.page();
if (page < MessagelistUserStore.pageCount()) {
MessagelistUserStore.page(1 + page);
MessagelistUserStore.reload(false, false, true);
}
}
}).debounce(1000),
{passive:true}
);
// initUploaderForAppend
if (Settings.app('allowAppendMessage')) {