Skip to content

Commit 13a2b36

Browse files
committed
Fixes based on CoPilot review
1 parent a53cb9a commit 13a2b36

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

app/assets/stylesheets/partials/_results.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@
156156
// --------------------------------------
157157

158158
.result.use, .result.primo {
159-
padding: 48px 0;
159+
padding: 32px 0 32px;
160160
margin: 0;
161-
border-bottom: 1px solid $color-gray-400;
161+
border-bottom: 1px solid $color-gray-200;
162162
border-top: none;
163163

164164
&:first-child {

app/javascript/source_tabs.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const initTabs = () => {
1111
if (container.classList.contains('has-js')) return // Already initialized
1212

1313
const primary = container.querySelector('.primary')
14-
const primaryItems = container.querySelectorAll('.primary > li:not(.-more)')
1514

1615
// Add a class to turn off graceful degradation style
1716
container.classList.add('has-js')
@@ -28,7 +27,6 @@ const initTabs = () => {
2827
</li>
2928
`)
3029
const secondary = container.querySelector('.-secondary')
31-
const secondaryItems = secondary.querySelectorAll('li')
3230
const allItems = container.querySelectorAll('li')
3331
const moreLi = primary.querySelector('.-more')
3432
const moreBtn = moreLi.querySelector('button')
@@ -188,7 +186,10 @@ const initTabs = () => {
188186

189187
// Initialize on page load and after Turbo navigates
190188
// turbo:load fires on both initial page load and subsequent Turbo navigations
191-
document.addEventListener('turbo:load', initTabs)
189+
if (!window.__timdexSourceTabsTurboListenerAdded) {
190+
window.__timdexSourceTabsTurboListenerAdded = true
191+
document.addEventListener('turbo:load', initTabs)
192+
}
192193

193194
// Run immediately in case turbo:load already fired before this script loaded
194195
// (happens on first search when Turbo Drive loads the page containing this script)

0 commit comments

Comments
 (0)