From 4be68b06c2cb954feb6e0d090579973e24a2135b Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Thu, 10 Oct 2024 13:53:50 -0500 Subject: [PATCH] Remove vestiges of turbolinks --- app/javascript/blacklight/core.js | 12 ++---------- app/views/catalog/_search_results.html.erb | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/javascript/blacklight/core.js b/app/javascript/blacklight/core.js index 937b5318b3..952ba28c71 100644 --- a/app/javascript/blacklight/core.js +++ b/app/javascript/blacklight/core.js @@ -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'); } @@ -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() diff --git a/app/views/catalog/_search_results.html.erb b/app/views/catalog/_search_results.html.erb index 421ed3f58a..1cd856f973 100644 --- a/app/views/catalog/_search_results.html.erb +++ b/app/views/catalog/_search_results.html.erb @@ -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' } %> + <%= link_to t('blacklight.skip_links.first_result'), '#documents', class: 'd-inline-flex p-2 m-1' %> <% end %> <% content_for(:container_header) do -%>