make virtual scrolling optional in case people want to be able to ctrl-f all page

This commit is contained in:
Shpuld Shpuldson 2020-01-15 17:01:18 +02:00
parent 42f8fb2dca
commit c49b8e2089
7 changed files with 16 additions and 4 deletions

View file

@ -92,6 +92,11 @@
{{ $t('settings.reply_link_preview') }}
</Checkbox>
</li>
<li>
<Checkbox v-model="virtualScrolling">
{{ $t('settings.virtual_scrolling') }}
</Checkbox>
</li>
</ul>
</div>

View file

@ -70,11 +70,14 @@ const Timeline = {
pinnedStatusIdsObject () {
return keyBy(this.pinnedStatusIds)
},
displayingStatuses () {
statusesToDisplay () {
const amount = this.timeline.visibleStatuses.length
const min = Math.max(0, this.vScrollIndex - 20)
const max = Math.min(amount, this.vScrollIndex + 20)
return this.timeline.visibleStatuses.slice(min, max).map(_ => _.id)
},
virtualScrollingEnabled () {
return this.$store.getters.mergedConfig.virtualScrolling
}
},
components: {

View file

@ -56,7 +56,7 @@
:collapsable="true"
:in-profile="inProfile"
:profile-user-id="userId"
:virtualHidden="!displayingStatuses.includes(status.id)"
:virtualHidden="virtualScrollingEnabled && !statusesToDisplay.includes(status.id)"
/>
</template>
</div>

View file

@ -375,6 +375,7 @@
"false": "no",
"true": "yes"
},
"virtual_scrolling": "Optimize timeline rendering",
"fun": "Fun",
"greentext": "Meme arrows",
"notifications": "Notifications",

View file

@ -228,7 +228,8 @@
"values": {
"false": "pois päältä",
"true": "päällä"
}
},
"virtual_scrolling": "Optimoi aikajanan suorituskykyä"
},
"time": {
"day": "{0} päivä",

View file

@ -49,7 +49,8 @@ export const defaultState = {
useContainFit: false,
greentext: undefined, // instance default
hidePostStats: undefined, // instance default
hideUserStats: undefined // instance default
hideUserStats: undefined, // instance default
virtualScrolling: undefined // instance default
}
// caching the instance default properties

View file

@ -34,6 +34,7 @@ const defaultState = {
showFeaturesPanel: true,
minimalScopesMode: false,
greentext: false,
virtualScrolling: true,
// Nasty stuff
pleromaBackend: true,