Add skip links to readinglist, podcasts, and listings (#12769)
* add skip link functionality to readinglist, listings and podcasts * fix initscrolling reference to podcasts
This commit is contained in:
parent
acb79a2cf2
commit
5abe88c69b
5 changed files with 8 additions and 8 deletions
|
|
@ -375,7 +375,7 @@ function fetchNextPageIfNearBottom() {
|
|||
var scrollableElem;
|
||||
|
||||
if (indexWhich === 'podcast-episodes') {
|
||||
scrollableElem = document.getElementById('articles-list');
|
||||
scrollableElem = document.getElementById('main-content');
|
||||
fetchCallback = function fetch() {
|
||||
fetchNextPodcastPage(indexContainer);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export const AllListings = ({
|
|||
loadNextPage,
|
||||
}) => {
|
||||
return (
|
||||
<main class="crayons-layout__content">
|
||||
<main class="crayons-layout__content" id="main-content">
|
||||
<div className="listings-columns" id="listings-results">
|
||||
{listings.map((listing) => (
|
||||
<SingleListing
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ export class ReadingList extends Component {
|
|||
onClick={this.toggleTag}
|
||||
/>
|
||||
|
||||
<main className="crayons-layout__content">
|
||||
<main className="crayons-layout__content" id="main-content">
|
||||
<div className="crayons-card mb-4">
|
||||
{items.length > 0 ? itemsToRender : this.renderEmptyItems()}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
data-feed="<%= params[:timeframe] || "base-feed" %>"
|
||||
data-articles-since="<%= Timeframe.datetime_iso8601(params[:timeframe]) %>">
|
||||
<%= render "podcast_episodes/sidebar" %>
|
||||
<div class="articles-list" id="articles-list">
|
||||
<main class="articles-list" id="main-content">
|
||||
<div class="substories" id="substories">
|
||||
<% if @podcast_episodes %>
|
||||
<%= render "podcast_episodes/episodes_feed" %>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ RSpec.describe "User visits /pod page", type: :system do
|
|||
before { visit "/pod" }
|
||||
|
||||
it "displays the podcasts", js: true do
|
||||
within "#articles-list" do
|
||||
within "#main-content" do
|
||||
expect(page).to have_link(nil, href: podcast_episode1.path)
|
||||
expect(page).to have_link(nil, href: podcast_episode2.path)
|
||||
expect(page).to have_link(nil, href: podcast_episode3.path)
|
||||
|
|
@ -20,20 +20,20 @@ RSpec.describe "User visits /pod page", type: :system do
|
|||
end
|
||||
|
||||
it "displays the podcasts with published_at" do
|
||||
within "#articles-list" do
|
||||
within "#main-content" do
|
||||
expect(page).to have_selector("time.published-at", count: 2)
|
||||
expect(page).to have_selector("span.time-ago-indicator-initial-placeholder", count: 2)
|
||||
end
|
||||
end
|
||||
|
||||
it "doesn't display an unreachable podcast" do
|
||||
within "#articles-list" do
|
||||
within "#main-content" do
|
||||
expect(page).not_to have_link(nil, href: un_podcast_episode.path)
|
||||
end
|
||||
end
|
||||
|
||||
it "doesn't dsplay a podcast that is not published" do
|
||||
within "#articles-list" do
|
||||
within "#main-content" do
|
||||
expect(page).not_to have_link(nil, href: unpublished_episode.path)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue