diff --git a/static/js/skills.js b/static/js/skills.js index 81dcebc2c..b29869a7d 100644 --- a/static/js/skills.js +++ b/static/js/skills.js @@ -1260,6 +1260,9 @@ async function _expandSkillCard(card, name) { card._md = md || ''; } else { pre.textContent = 'Loading…'; + const editBtn = [...card.querySelectorAll('.skill-card-preview button')] + .find(button => button.textContent.trim() === 'Edit'); + if (editBtn) editBtn.disabled = true; try { const md = await _fetchSkillMarkdown(name); pre.textContent = md || '(empty)'; @@ -1267,6 +1270,8 @@ async function _expandSkillCard(card, name) { card._md = md; } catch (e) { pre.textContent = `Failed to load SKILL.md: ${e.message || 'Unknown error'}`; + } finally { + if (editBtn) editBtn.disabled = !card._mdLoaded; } } } @@ -1275,6 +1280,9 @@ async function _expandSkillCard(card, name) { // Swap the read-only
for an editable