Skip to content

Commit 7141740

Browse files
committed
Stop loading spinner from firing on every element click in tab bar
1 parent 8c20cf5 commit 7141740

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/javascript/loading_spinner.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ document.addEventListener('click', function(event) {
6868

6969
// Handle tab clicks
7070
if (clickedElement.closest('.tab-navigation')) {
71+
72+
// If the element is NOT a link, don't show the spinner
73+
if (clickedElement.nodeName !== "A") { return; }
74+
7175
const clickedParams = new URLSearchParams(clickedElement.search);
7276
const newTab = clickedParams.get('tab');
7377

0 commit comments

Comments
 (0)