Fix: Podcast-Selector im Hauptbereich statt nur im Seitenpanel
Der Selector war vorher nur im 400px-Panel rechts sichtbar — auf Mobile oder bei schmalem Fenster quasi unsichtbar. Jetzt wird er zentriert im Mindmap-Bereich angezeigt, bis ein Podcast gewählt wird. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
78d66bef21
commit
c146d7ddb2
@ -921,13 +921,19 @@ async function selectPodcast(podcastId) {
|
||||
const resp = await fetch(`${API_BASE}/api/podcasts/${podcastId}`);
|
||||
DATA = await resp.json();
|
||||
CURRENT_PODCAST = podcastId;
|
||||
// Clear existing graph + timeline if switching
|
||||
document.getElementById('svg').innerHTML = '';
|
||||
// Reset mindmap area (might have been used for selector)
|
||||
const mindmap = document.getElementById('mindmap');
|
||||
mindmap.style.display = '';
|
||||
mindmap.style.alignItems = '';
|
||||
mindmap.style.justifyContent = '';
|
||||
mindmap.style.flexDirection = '';
|
||||
mindmap.style.padding = '';
|
||||
mindmap.innerHTML = '<svg id="svg"></svg>';
|
||||
// Clear filters + timeline
|
||||
document.getElementById('staffel-filters').innerHTML = '';
|
||||
const tl = document.getElementById('timeline-container');
|
||||
if (tl) { tl.remove(); timelineBuilt = false; }
|
||||
// Reset to mindmap view
|
||||
document.getElementById('mindmap').style.display = '';
|
||||
document.querySelectorAll('.view-tab').forEach(t => t.classList.remove('active'));
|
||||
document.getElementById('tab-mindmap')?.classList.add('active');
|
||||
TRANSCRIPTS = null;
|
||||
@ -949,24 +955,35 @@ function showPodcastSelector(podcasts) {
|
||||
document.getElementById('cross-toggle').style.display = '';
|
||||
}
|
||||
|
||||
let html = '<div class="welcome"><h2>Podcast Mindmap</h2><p>Wähle einen Podcast oder vergleiche zwei.</p></div>';
|
||||
html += '<div class="podcast-selector" id="podcast-selector">';
|
||||
// Hide mindmap, show selector full-width in mindmap area
|
||||
mindmap.innerHTML = '';
|
||||
mindmap.style.display = 'flex';
|
||||
mindmap.style.alignItems = 'center';
|
||||
mindmap.style.justifyContent = 'center';
|
||||
mindmap.style.flexDirection = 'column';
|
||||
mindmap.style.padding = '20px';
|
||||
|
||||
let selectorHtml = '<div class="welcome"><h2>Podcast Mindmap</h2><p>Wähle einen Podcast oder vergleiche zwei.</p></div>';
|
||||
selectorHtml += '<div class="podcast-selector" id="podcast-selector">';
|
||||
podcasts.forEach(p => {
|
||||
html += `<div class="podcast-card" id="pc-${p.id}" onclick="selectPodcast('${p.id}')">`;
|
||||
html += `<h3>${escHtml(p.name)}</h3>`;
|
||||
html += `<p>${escHtml(p.description || '')}</p>`;
|
||||
html += `</div>`;
|
||||
selectorHtml += `<div class="podcast-card" id="pc-${p.id}" onclick="selectPodcast('${p.id}')">`;
|
||||
selectorHtml += `<h3>${escHtml(p.name)}</h3>`;
|
||||
selectorHtml += `<p>${escHtml(p.description || '')}</p>`;
|
||||
selectorHtml += `</div>`;
|
||||
});
|
||||
html += '</div>';
|
||||
selectorHtml += '</div>';
|
||||
|
||||
if (podcasts.length > 1) {
|
||||
html += '<div class="compare-actions">';
|
||||
html += '<button class="compare-btn" onclick="startCompare()">Podcasts vergleichen</button>';
|
||||
html += '</div>';
|
||||
selectorHtml += '<div class="compare-actions">';
|
||||
selectorHtml += '<button class="compare-btn" onclick="startCompare()">Podcasts vergleichen</button>';
|
||||
selectorHtml += '</div>';
|
||||
}
|
||||
|
||||
html += '<div id="compare-result"></div>';
|
||||
panel.innerHTML = html;
|
||||
selectorHtml += '<div id="compare-result"></div>';
|
||||
mindmap.innerHTML = selectorHtml;
|
||||
|
||||
// Panel: minimal welcome
|
||||
panel.innerHTML = '<div class="welcome"><h2>Willkommen</h2><p>Wähle links einen Podcast.</p></div>';
|
||||
|
||||
document.getElementById('app-title').textContent = 'Podcast';
|
||||
document.title = 'Podcast Mindmap';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user