8000 Remove vestiges of turbolinks by jcoyne · Pull Request #3356 · projectblacklight/blacklight · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove vestiges of turbolinks #3356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions app/javascript/blacklight/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ const Core = function() {
const listeners = [];
if (typeof Turbo !== 'undefined') {
listeners.push('turbo:load', 'turbo:frame-load');
} else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
// Turbolinks 5
if (Turbolinks.BrowserAdapter) {
listeners.push('turbolinks:load');
} else {
// Turbolinks < 5
listeners.push('page:load', 'DOMContentLoaded');
}
} else {
listeners.push('DOMContentLoaded');
}
Expand All @@ -32,8 +24,8 @@ const Core = function() {
};
}();

// turbolinks triggers page:load events on page transition
// If app isn't using turbolinks, this event will never be triggered, no prob.
// turbo triggers turbo:load events on page transition
// If app isn't using turbo, this event will never be triggered, no prob.
Core.listeners().forEach(function(listener) {
document.addEventListener(listener, function() {
Core.activate()
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_search_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% end %>

<% content_for(:skip_links) do -%>
<%= link_to t('blacklight.skip_links.first_result'), '#documents', class: 'd-inline-flex p-2 m-1', data: { turbolinks: 'false' } %>
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be data: { turbo: false }?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that turbo needs to skip this. I'm pretty sure it knows that intra-document links don't get cached.

<%= link_to t('blacklight.skip_links.first_result'), '#documents', class: 'd-inline-flex p-2 m-1' %>
<% end %>

<% content_for(:container_header) do -%>
Expand Down
0