From b1e6a33d6b7d24ee8bb21bf2b01e5ffc3f6dc931 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 29 Jul 2021 23:59:45 +0900 Subject: tweak style --- src/client/scripts/paging.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/client/scripts') diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts index bcb0d7f2b0..194c2e8003 100644 --- a/src/client/scripts/paging.ts +++ b/src/client/scripts/paging.ts @@ -94,7 +94,11 @@ export default (opts) => ({ for (let i = 0; i < items.length; i++) { const item = items[i]; markRaw(item); - if (i === 3) item._shouldInsertAd_ = true; + if (this.pagination.reversed) { + if (i === items.length - 2) item._shouldInsertAd_ = true; + } else { + if (i === 3) item._shouldInsertAd_ = true; + } } if (!this.pagination.noPaging && (items.length > (this.pagination.limit || 10))) { items.pop(); @@ -133,7 +137,11 @@ export default (opts) => ({ for (let i = 0; i < items.length; i++) { const item = items[i]; markRaw(item); - if (i === 10) item._shouldInsertAd_ = true; + if (this.pagination.reversed) { + if (i === items.length - 9) item._shouldInsertAd_ = true; + } else { + if (i === 10) item._shouldInsertAd_ = true; + } } if (items.length > SECOND_FETCH_LIMIT) { items.pop(); -- cgit v1.2.3-freya