Skip to content

Commit b261749

Browse files
Try walking back using an explicit spinner class
1 parent f35d4ca commit b261749

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

app/assets/stylesheets/partials/_loading_spinner.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
// Pagination overlay when loading
11-
.spinner {
11+
[busy]:not([no-spinner]) {
1212
position: relative;
1313
min-height: 400px;
1414
display: block;

app/javascript/loading_spinner.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ document.addEventListener('turbo:frame-render', function(event) {
3939
// console.log(`Updated tab input value to: ${queryParam}`);
4040
}
4141

42-
// Remove the spinner now that things are ready
43-
document.getElementById('search-results').classList.remove('spinner');
44-
4542
// Clear the pending action
4643
window.pendingFocusAction = null;
4744
};
@@ -62,10 +59,6 @@ document.addEventListener('click', function(event) {
6259
const clickedParams = new URLSearchParams(clickedElement.search);
6360
const newTab = clickedParams.get('tab');
6461

65-
// Throw the spinner on the search results immediately
66-
document.getElementById('search-results').classList.add('spinner');
67-
68-
// Position the window at the top of the results
6962
window.scrollTo({ top: 0, behavior: 'smooth' });
7063

7164
swapTabs(newTab);

0 commit comments

Comments
 (0)