Skip to content

Commit 7c65334

Browse files
committed
fix filtering
1 parent b0e75ba commit 7c65334

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

_layouts/default.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,23 @@ <h3>e-Books by @f</h3>
20882088
const grokOptions = document.querySelectorAll('.grok-mode-option');
20892089
let isGrokDropdownVisible = false;
20902090

2091+
// Add event listeners for all platform buttons
2092+
const platformButtons = document.querySelectorAll('.platform-tag');
2093+
platformButtons.forEach(button => {
2094+
button.addEventListener('click', () => {
2095+
const platform = button.getAttribute('data-platform');
2096+
// If platform is not github-copilot, set audience to "everyone"
2097+
if (platform !== 'github-copilot') {
2098+
audienceSelect.value = 'everyone';
2099+
document.body.classList.remove('dev-mode');
2100+
// Trigger filtering if needed
2101+
if (typeof filterPrompts === 'function') {
2102+
filterPrompts();
2103+
}
2104+
}
2105+
});
2106+
});
2107+
20912108
// Hide dropdown when clicking outside
20922109
document.addEventListener('click', (e) => {
20932110
if (!e.target.closest('.platform-tag-container')) {
@@ -2112,6 +2129,14 @@ <h3>e-Books by @f</h3>
21122129
grokButton.textContent = selectedText;
21132130
grokDropdown.style.display = 'none';
21142131
isGrokDropdownVisible = false;
2132+
2133+
// Also set audience to "everyone" for Grok options
2134+
audienceSelect.value = 'everyone';
2135+
document.body.classList.remove('dev-mode');
2136+
// Trigger filtering if needed
2137+
if (typeof filterPrompts === 'function') {
2138+
filterPrompts();
2139+
}
21152140
});
21162141
});
21172142
});

0 commit comments

Comments
 (0)