diff --git a/README.md b/README.md index 3ddc081d..373b3b15 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ - script to get new emojis is included for future unicode versions - add toggle for showing post edit notifications - add support for accepted follow request notifications +- add option to prevent page from getting pushed when making a new post with streaming api enabled (similar to 3rd "for unreads" option) - add a script to download ruffle for flash support (requires python3 and requests library) - download by entering `tools/` and running `python3 download_ruffle.py` diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index d40d2290..cb0536d2 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -436,6 +436,8 @@ const PostStatusForm = { const postHandler = this.postHandler ? this.postHandler : statusPoster.postStatus + let bef = document.getElementsByClassName("Timeline")[0].scrollHeight + postHandler(postingOptions).then((data) => { if (!data.error) { this.clearStatus() @@ -444,6 +446,14 @@ const PostStatusForm = { this.error = data.error } this.posting = false + + // same as timeline.js + if (this.$store.getters.mergedConfig.fixupScrollOnPostWStreaming && window.scrollY > 0) { + let after = document.getElementsByClassName("Timeline")[0].scrollHeight + let diff = bef - after + if (diff < 0) diff = diff * -1 + window.scrollTo({ top: (window.scrollY + diff) }) + } }) }, previewStatus () { diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index ed3b3c3d..8b7fa9e4 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -229,6 +229,15 @@ {{ $t('settings.deletePostsStreaming') }} +