Keep scroll position on preview toggle

This commit is contained in:
Pavel Djundik 2018-07-25 14:04:10 +03:00 committed by Pavel Djundik
parent 0c5faf5879
commit fea6fff13a
2 changed files with 3 additions and 0 deletions

View File

@ -193,6 +193,7 @@ export default {
}, },
onMoreClick() { onMoreClick() {
this.isContentShown = !this.isContentShown; this.isContentShown = !this.isContentShown;
this.keepScrollPosition();
}, },
}, },
}; };

View File

@ -224,6 +224,8 @@ export default {
clipboard(this.$el); clipboard(this.$el);
}, },
onLinkPreviewToggle(preview, message) { onLinkPreviewToggle(preview, message) {
this.keepScrollPosition();
// Tell the server we're toggling so it remembers at page reload // Tell the server we're toggling so it remembers at page reload
// TODO Avoid sending many single events when using `/collapse` or `/expand` // TODO Avoid sending many single events when using `/collapse` or `/expand`
// See https://github.com/thelounge/thelounge/issues/1377 // See https://github.com/thelounge/thelounge/issues/1377