const CLS_PLAYLIST_ROW = 'playlist_row';
events_params += 'playlist=1';
+var first_load = true;
function new_child_to(tag, parent, textContent='') {
const el = document.createElement(tag);
const file = data.playlist_files[i];
const tr = new_child_to('tr', table);
tr.classList.add(CLS_PLAYLIST_ROW);
+ const td_anchor = new_child_to('td', tr);
+ td_anchor.id = `${i}`
+ const a_row = new_child_to('a', td_anchor, '#');
+ a_row.href = `#${i}`
const td_entry_control = new_child_to('td', tr);
td_entry_control.classList.add('entry_control');
if (i == data.idx) {
- td_entry_control.textContent = 'playing'; }
+ td_entry_control.textContent = 'playing';
+ td_entry_control.id = 'playing';
+ if (first_load) { // to replace anchor jump to #playing, which on first
+ first_load = false; // load will not work yet since element not built yet
+ td_entry_control.scrollIntoView({block: 'center'}); }
+ }
else {
for (const [symbol, prefix] of [['>', 'jump'],
['^', 'up'],
<td class="screen_half">
<table id="playlist_rows">
-<tr><th colspan=2 class="screen_half_titles">playlist</th></tr>
+<tr><th colspan=3 class="screen_half_titles">playlist (<a href="#playing">#playing</a>)</th></tr>
</table>
</td>