1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-28 11:50:26 +00:00

Fixing incremental table change

This commit is contained in:
jcorporation 2018-05-30 01:28:36 +02:00
parent 0039fabc50
commit 060aeff3ff

View File

@ -300,7 +300,7 @@ function webSocketConnect() {
"<td>"+ obj.data[song].album +"</td>" + "<td>"+ obj.data[song].album +"</td>" +
"<td>"+ minutes + ":" + (seconds < 10 ? '0' : '') + seconds + "<td>"+ minutes + ":" + (seconds < 10 ? '0' : '') + seconds +
"</td><td></td></tr>"; "</td><td></td></tr>";
if (nrItems < tr.length) { $(tr[nrItems-1]).replaceWith(row); } if (nrItems <= tr.length) { $(tr[nrItems-1]).replaceWith(row); }
else { $('#'+current_app+'List > tbody').append(row); } else { $('#'+current_app+'List > tbody').append(row); }
} }
for (var i=tr.length;i>nrItems;i--) { for (var i=tr.length;i>nrItems;i--) {
@ -401,7 +401,7 @@ function webSocketConnect() {
if (nrItems == 0) { if (nrItems == 0) {
$('#'+current_app+'List > tbody').append( $('#'+current_app+'List > tbody').append(
"<tr><td><span class=\"material-icons\">error_outline</span></td>" + "<tr><td><span class=\"material-icons\">error_outline</span></td>" +
"<td colspan=\"3\">No results</td>" + "<td colspan=\"3\">No playlists found.</td>" +
"<td></td><td></td></tr>" "<td></td><td></td></tr>"
); );
} }
@ -441,7 +441,7 @@ function webSocketConnect() {
'</td><td></td></tr>'; '</td><td></td></tr>';
break; break;
} }
if (nrItems < tr.length) { $(tr[nrItems-1]).replaceWith(row); } if (nrItems <= tr.length) { $(tr[nrItems-1]).replaceWith(row); }
else { $('#'+current_app+'List > tbody').append(row); } else { $('#'+current_app+'List > tbody').append(row); }
} }
for (var i=tr.length;i>nrItems;i--) { for (var i=tr.length;i>nrItems;i--) {