remove mindless dev comments
This commit is contained in:
@@ -77,41 +77,33 @@ const displayedScenarios = scenarios.slice(0, maxDisplayed);
|
||||
|
||||
if (!mainSearchInput) return;
|
||||
|
||||
// Check if this scenario is already active (allow deselection)
|
||||
if (clickedChip && clickedChip.classList.contains('active')) {
|
||||
// Deselect: clear search and remove active state
|
||||
mainSearchInput.value = '';
|
||||
document.querySelectorAll('.suggestion-chip').forEach(chip => {
|
||||
chip.classList.remove('active');
|
||||
});
|
||||
|
||||
// Clear the targeted search input too
|
||||
const targetedInput = document.getElementById('targeted-search-input');
|
||||
if (targetedInput) {
|
||||
targetedInput.value = '';
|
||||
}
|
||||
|
||||
// Trigger search to show all results
|
||||
const inputEvent = new Event('input', { bubbles: true });
|
||||
mainSearchInput.dispatchEvent(inputEvent);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply new search
|
||||
mainSearchInput.value = scenarioId;
|
||||
|
||||
// Trigger existing search functionality
|
||||
const inputEvent = new Event('input', { bubbles: true });
|
||||
mainSearchInput.dispatchEvent(inputEvent);
|
||||
|
||||
// Switch to grid view
|
||||
const gridToggle = document.querySelector('.view-toggle[data-view="grid"]');
|
||||
if (gridToggle && !gridToggle.classList.contains('active')) {
|
||||
gridToggle.click();
|
||||
}
|
||||
|
||||
// Visual feedback
|
||||
document.querySelectorAll('.suggestion-chip').forEach(chip => {
|
||||
chip.classList.remove('active');
|
||||
});
|
||||
@@ -119,17 +111,14 @@ const displayedScenarios = scenarios.slice(0, maxDisplayed);
|
||||
clickedChip.classList.add('active');
|
||||
}
|
||||
|
||||
// Scroll to results with better positioning
|
||||
window.scrollToElementById('tools-grid');
|
||||
};
|
||||
|
||||
// Toggle showing all scenarios
|
||||
window.toggleAllScenarios = function() {
|
||||
const suggestionsContainer = document.getElementById('scenario-suggestions');
|
||||
const moreBtn = document.getElementById('more-scenarios-btn');
|
||||
|
||||
if (!showingAllScenarios) {
|
||||
// Show additional scenarios
|
||||
const additionalScenarios = allScenarios.slice(maxDisplay);
|
||||
additionalScenarios.forEach(scenario => {
|
||||
const chip = document.createElement('div');
|
||||
@@ -146,14 +135,12 @@ const displayedScenarios = scenarios.slice(0, maxDisplayed);
|
||||
moreBtn.textContent = 'Weniger anzeigen';
|
||||
showingAllScenarios = true;
|
||||
} else {
|
||||
// Hide additional scenarios
|
||||
document.querySelectorAll('.additional-scenario').forEach(chip => chip.remove());
|
||||
moreBtn.textContent = `+ ${allScenarios.length - maxDisplay} weitere Szenarien`;
|
||||
showingAllScenarios = false;
|
||||
}
|
||||
};
|
||||
|
||||
// Handle targeted search input
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const targetedInput = document.getElementById('targeted-search-input');
|
||||
if (targetedInput) {
|
||||
|
||||
Reference in New Issue
Block a user