Fixed table flickering on top10 page
This commit is contained in:
@@ -920,13 +920,12 @@ function top10Miners_UpdateTop10 (xhrGetMiners, endPoint, key) {
|
|||||||
if (xhrGetMiners[key])
|
if (xhrGetMiners[key])
|
||||||
xhrGetMiners[key].abort()
|
xhrGetMiners[key].abort()
|
||||||
|
|
||||||
$(`#top10miners_rows${key}`)
|
let top10_body = $(`#top10_rows${key}`);
|
||||||
.empty();
|
|
||||||
|
|
||||||
xhrGetMiners[key] = $.ajax({
|
xhrGetMiners[key] = $.ajax({
|
||||||
url: `${endPoint}/get_top10miners`,
|
url: `${endPoint}/get_top10miners`,
|
||||||
data: {
|
data: {
|
||||||
time: $(`#top10_rows${key}`)
|
time: top10_body
|
||||||
.children()
|
.children()
|
||||||
.last()
|
.last()
|
||||||
.data('time')
|
.data('time')
|
||||||
@@ -936,8 +935,11 @@ function top10Miners_UpdateTop10 (xhrGetMiners, endPoint, key) {
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (!data) return;
|
if (!data) return;
|
||||||
for (var i=0; i<data.length; ++i) {
|
for (var i=0; i<data.length; ++i) {
|
||||||
$(`#top10miners_rows${key}`)
|
if ($('#top' + (i+1)).length) {
|
||||||
.append('<tr>' + top10Miners_GetMinerCells(i + 1, data[i]) + '</tr>');
|
$('#top' + (i+1)).html(top10Miners_GetMinerCells(i+1, data[i]));
|
||||||
|
} else {
|
||||||
|
$( top10_body.append('<tr id="top' + (i+1) + '">' + top10Miners_GetMinerCells(i+1, data[i]) + '</tr>'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user