diff --git a/frontend/admin.html b/frontend/admin.html
index 8d14b0b..0d8cbc4 100644
--- a/frontend/admin.html
+++ b/frontend/admin.html
@@ -321,7 +321,7 @@
-
+
Lyrics Studio
Sign in
Admin password
@@ -340,7 +340,7 @@
-
+ Lyrics Studio
← Back to app
@@ -1358,7 +1358,9 @@
}
function seek(t) { if (!LE.audio) return; LE.audio.currentTime = Math.max(0, Math.min(LE.dur || 1e9, t)); tick(); }
function stamp(i) {
- if (!LE.audio || i < 0 || i >= LE.lines.length) return;
+ if (i < 0 || i >= LE.lines.length) return;
+ if (!LE.audio) { say('The audio is still loading — try again in a moment.', 'err'); return; }
+ if (LE.sel !== i) select(i);
edit(() => { LE.lines[i].t = r2(cur()); });
paintRow(i); progress(); lastIdx = -2; tick(); tapLabel();
}
@@ -1367,7 +1369,7 @@
$('lines').addEventListener('click', async (e) => {
const row = e.target.closest('.ln'); if (!row) return;
const i = Number(row.dataset.i);
- if (LE.sel !== i) select(i);
+ if (LE.sel !== i || !row.classList.contains('sel')) select(i);
const btn = e.target.closest('button[data-act]'); if (!btn) return;
const act = btn.dataset.act;
if (act === 'chip') {
@@ -1420,6 +1422,13 @@
$('bUndo').addEventListener('click', doUndo);
$('bRedo').addEventListener('click', doRedo);
$('bTools').addEventListener('click', () => { const on = $('drawer').classList.toggle('hidden') === false; $('bTools').setAttribute('aria-pressed', String(on)); });
+ document.querySelectorAll('[data-home]').forEach((a) => a.addEventListener('click', (e) => {
+ e.preventDefault();
+ if (!$('app').classList.contains('hidden')) {
+ if (LE.loaded && !$('studio').classList.contains('hidden')) $('closeSong').click();
+ showTab('editor');
+ } else location.href = '/admin#editor';
+ }));
$('closeSong').addEventListener('click', () => {
if (LE.dirty && !confirm('Discard the unsaved changes to this song?')) return;
if (LE.audio) { LE.audio.pause(); LE.audio = null; }