Skip to content

Infinite scroll with Turbo Frames#2

Open
foxy-eyed wants to merge 4 commits intoday-1from
feature/artist-all-tracks
Open

Infinite scroll with Turbo Frames#2
foxy-eyed wants to merge 4 commits intoday-1from
feature/artist-all-tracks

Conversation

@foxy-eyed
Copy link
Owner

Необходимо добавить новую страницу со всеми треками артиста с ленивой подгрузкой треков при прокрутке (aka infinite scroll pagination). Использовать только Turbo Frames.

Copy link

@palkan palkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что-то получилось, но это какой-то хак!)

Всё так 🙂

криво работает проигрывание треков из фрейма

Да, это автоматически исправится после изменений в плеере. Сейчас это не нужно править.

А так всё отлично)

@@ -0,0 +1,10 @@
<%# locals: (artist:, tracks:, current_page:, next_page:, offset:, **) -%>

<%= turbo_frame_tag "tracks-#{artist.id}-#{current_page}", target: "_top" do %>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чуть получше, на мой взгляд, выглядит с dom_id:

Suggested change
<%= turbo_frame_tag "tracks-#{artist.id}-#{current_page}", target: "_top" do %>
<%= turbo_frame_tag dom_id(artist, :"tracks_#{current_page}"), target: "_top" do %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants