Spaces:
Paused
Paused
Fix: Hide explanation in flashcard list preview and make entire row clickable for editing
Browse files- index.html +1 -1
- src/views/learn/learn-view.js +3 -6
index.html
CHANGED
|
@@ -51,7 +51,7 @@
|
|
| 51 |
</head>
|
| 52 |
<body class="dark-theme in-chat-view">
|
| 53 |
|
| 54 |
-
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.1.
|
| 55 |
|
| 56 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 57 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
|
|
|
| 51 |
</head>
|
| 52 |
<body class="dark-theme in-chat-view">
|
| 53 |
|
| 54 |
+
<div id="live-version-badge" style="position: fixed; top: 50px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); opacity: 0.6; z-index: 99999; pointer-events: none; font-weight: 500; font-family: monospace; letter-spacing: 1px; background: rgba(0,0,0,0.2); padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.05);">BUILD 1.1.87</div>
|
| 55 |
|
| 56 |
<!-- SVG Filters for Liquid Glass Refraction -->
|
| 57 |
<svg width="0" height="0" style="position: absolute; pointer-events: none;">
|
src/views/learn/learn-view.js
CHANGED
|
@@ -197,7 +197,7 @@ export class LearnView {
|
|
| 197 |
<div style="display: flex; flex-direction: column;">
|
| 198 |
${allCards.map((card, index) => {
|
| 199 |
// Extract the first part of back for the preview (before the explanation)
|
| 200 |
-
let previewBack = (card.back || '').split('\
|
| 201 |
if (previewBack.length > 60) previewBack = previewBack.substring(0, 60) + '...';
|
| 202 |
|
| 203 |
// Escape quotes for onclick
|
|
@@ -205,15 +205,12 @@ export class LearnView {
|
|
| 205 |
const safeBack = card.back.replace(/'/g, "\\'").replace(/"/g, """);
|
| 206 |
|
| 207 |
return `
|
| 208 |
-
<div style="display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: ${index === deck.total_count - 1 ? 'none' : '1px solid var(--border)'}; transition: background 0.2s;" onmouseover="this.style.background='rgba(255,255,255,0.02)'" onmouseout="this.style.background='transparent'">
|
| 209 |
<div style="flex: 1; min-width: 0; padding-right: 12px;">
|
| 210 |
<div style="font-weight: 500; font-size: 16px; margin-bottom: 4px; color: var(--text-primary); text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">${card.front}</div>
|
| 211 |
<div style="font-size: 13px; color: var(--text-secondary); text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">${previewBack}</div>
|
| 212 |
</div>
|
| 213 |
-
<div style="display: flex; gap: 4px; flex-shrink: 0;">
|
| 214 |
-
<button onclick="window.learnView.editCard('${card.id}', '${deckId}', '${safeFront}', '${safeBack}')" class="icon-btn" style="background: rgba(255,255,255,0.05); color: var(--text-primary); border: none; padding: 8px; border-radius: 8px;" title="Bearbeiten">
|
| 215 |
-
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
|
| 216 |
-
</button>
|
| 217 |
<button onclick="window.learnView.deleteCard('${card.id}', '${deckId}')" class="icon-btn" style="background: rgba(255,75,75,0.1); color: #ff4b4b; border: none; padding: 8px; border-radius: 8px;" title="Löschen">
|
| 218 |
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
|
| 219 |
</button>
|
|
|
|
| 197 |
<div style="display: flex; flex-direction: column;">
|
| 198 |
${allCards.map((card, index) => {
|
| 199 |
// Extract the first part of back for the preview (before the explanation)
|
| 200 |
+
let previewBack = (card.back || '').split('\n\n**Erklärung:**')[0].trim();
|
| 201 |
if (previewBack.length > 60) previewBack = previewBack.substring(0, 60) + '...';
|
| 202 |
|
| 203 |
// Escape quotes for onclick
|
|
|
|
| 205 |
const safeBack = card.back.replace(/'/g, "\\'").replace(/"/g, """);
|
| 206 |
|
| 207 |
return `
|
| 208 |
+
<div onclick="window.learnView.editCard('${card.id}', '${deckId}', '${safeFront}', '${safeBack}')" style="display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: ${index === deck.total_count - 1 ? 'none' : '1px solid var(--border)'}; cursor: pointer; transition: background 0.2s;" onmouseover="this.style.background='rgba(255,255,255,0.02)'" onmouseout="this.style.background='transparent'">
|
| 209 |
<div style="flex: 1; min-width: 0; padding-right: 12px;">
|
| 210 |
<div style="font-weight: 500; font-size: 16px; margin-bottom: 4px; color: var(--text-primary); text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">${card.front}</div>
|
| 211 |
<div style="font-size: 13px; color: var(--text-secondary); text-overflow: ellipsis; overflow: hidden; white-space: nowrap;">${previewBack}</div>
|
| 212 |
</div>
|
| 213 |
+
<div style="display: flex; gap: 4px; flex-shrink: 0;" onclick="event.stopPropagation()">
|
|
|
|
|
|
|
|
|
|
| 214 |
<button onclick="window.learnView.deleteCard('${card.id}', '${deckId}')" class="icon-btn" style="background: rgba(255,75,75,0.1); color: #ff4b4b; border: none; padding: 8px; border-radius: 8px;" title="Löschen">
|
| 215 |
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg>
|
| 216 |
</button>
|