diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-17 19:47:48 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-17 19:47:48 -0800 |
| commit | d7c1cc00abe7c8097625ee905a1285aa0794a598 (patch) | |
| tree | 114ae9f7f09222f6881787360ffaa1385a69f834 /frontend-vanilla/src/main.ts | |
| parent | 5c5f440085255bf7f11af589faa4fa14d74f9294 (diff) | |
| download | neko-d7c1cc00abe7c8097625ee905a1285aa0794a598.tar.gz neko-d7c1cc00abe7c8097625ee905a1285aa0794a598.tar.bz2 neko-d7c1cc00abe7c8097625ee905a1285aa0794a598.zip | |
Remove visual 'selected' state highlight from feed items
Diffstat (limited to 'frontend-vanilla/src/main.ts')
| -rw-r--r-- | frontend-vanilla/src/main.ts | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/frontend-vanilla/src/main.ts b/frontend-vanilla/src/main.ts index abe454a..d769990 100644 --- a/frontend-vanilla/src/main.ts +++ b/frontend-vanilla/src/main.ts @@ -231,11 +231,7 @@ export function attachLayoutListeners() { const id = parseInt(itemRow.getAttribute('data-id')!); activeItemId = id; - // Update visual selection - document.querySelectorAll('.feed-item').forEach(el => { - const itemId = parseInt(el.getAttribute('data-id') || '0'); - el.classList.toggle('selected', itemId === activeItemId); - }); + activeItemId = id; const item = store.items.find(i => i._id === id); if (item && !item.read) { @@ -302,7 +298,7 @@ export function renderItems() { contentArea.innerHTML = ` <ul class="item-list"> - ${items.map((item: Item) => createFeedItem(item, item._id === activeItemId)).join('')} + ${items.map((item: Item) => createFeedItem(item)).join('')} </ul> ${store.hasMore ? '<div id="load-more-sentinel" class="loading-more">Loading more...</div>' : ''} `; @@ -854,12 +850,6 @@ function navigateItems(direction: number) { if (nextIndex >= 0 && nextIndex < store.items.length) { activeItemId = store.items[nextIndex]._id; - // Update visual selection without full re-render for speed - document.querySelectorAll('.feed-item').forEach(el => { - const id = parseInt(el.getAttribute('data-id') || '0'); - el.classList.toggle('selected', id === activeItemId); - }); - const el = document.querySelector(`.feed-item[data-id="${activeItemId}"]`); if (el) el.scrollIntoView({ block: 'start', behavior: 'instant' }); |
