website with merged support
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
</div>
|
||||
|
||||
<script id="siblingTabTemplate" type="text/x-handlebars-template">
|
||||
<li id="blockTabs{{coin}} role="presentation" class="{{active}}"><a href="#{{coin}}">{{coin}} {{symbol}}</a></li>
|
||||
<li id="blockTabs{{coin}} role="presentation" class="{{active}}"><a href="#{{coin}}">{{coin}} {{symbol}}</a></li>
|
||||
</script>
|
||||
|
||||
<script id="siblingTemplate" type="text/x-handlebars-template">
|
||||
<div role="tabpanel" class="tab-pane {{active}}" id="{{coin}}">
|
||||
<div role="tabpanel" class="tab-pane {{active}}" id="{{coin}}">
|
||||
<!-- Statistics -->
|
||||
<div class="blocksStats row">
|
||||
|
||||
@@ -101,52 +101,47 @@
|
||||
|
||||
<!-- Javascript -->
|
||||
<script>
|
||||
$('#blocksChartarqma')
|
||||
.hide();
|
||||
$('#blocksChartiridium')
|
||||
.hide();
|
||||
$('#blocksChartarqma').hide();
|
||||
$('#blocksChartiridium').hide();
|
||||
|
||||
let displayedChart = {};
|
||||
let xhrGetBlocks = {}
|
||||
let ranOnce = false
|
||||
// Update current page
|
||||
currentPage = {
|
||||
destroy: function () {
|
||||
if (xhrGetBlocks) {
|
||||
Object.keys(xhrGetBlocks)
|
||||
.forEach(key => {
|
||||
if (xhrGetBlocks[key])
|
||||
xhrGetBlocks[key].abort();
|
||||
$(`#loadMoreBlocks${key}`)
|
||||
.off('click')
|
||||
})
|
||||
}
|
||||
$('#blocksTabs a')
|
||||
.off('click')
|
||||
},
|
||||
update: function (updateKey) {
|
||||
let stats = updateKey === parentCoin ? lastStats : mergedStats[updateKey]
|
||||
if (stats) {
|
||||
displayedChart[updateKey] = false
|
||||
if (stats.charts.blocks) {
|
||||
poolBlocks_GenerateChart(stats, displayedChart);
|
||||
}
|
||||
poolBlocks_RenderBlocks(stats.pool.blocks, stats);
|
||||
}
|
||||
}
|
||||
};
|
||||
let displayedChart = {};
|
||||
let xhrGetBlocks = {}
|
||||
let ranOnce = false
|
||||
// Update current page
|
||||
currentPage = {
|
||||
destroy: function(){
|
||||
if (xhrGetBlocks) {
|
||||
Object.keys(xhrGetBlocks).forEach(key => {
|
||||
if (xhrGetBlocks[key])
|
||||
xhrGetBlocks[key].abort();
|
||||
$(`#loadMoreBlocks${key}`).off('click')
|
||||
})
|
||||
}
|
||||
$('#blocksTabs a').off('click')
|
||||
},
|
||||
update: function(updateKey){
|
||||
let stats = updateKey === parentCoin ? lastStats : mergedStats[updateKey]
|
||||
if (stats) {
|
||||
displayedChart[updateKey] = false
|
||||
if (stats.charts.blocks) {
|
||||
poolBlocks_GenerateChart(stats, displayedChart);
|
||||
}
|
||||
poolBlocks_RenderBlocks(stats.pool.blocks, stats);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function RunOnce () {
|
||||
$('#blocksTabs a')
|
||||
.click(function (e) {
|
||||
e.preventDefault()
|
||||
$(this)
|
||||
.tab('show')
|
||||
})
|
||||
return true
|
||||
}
|
||||
function RunOnce() {
|
||||
$('#blocksTabs a').click(function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
poolBlocks_InitTemplate(ranOnce, displayedChart, xhrGetBlocks)
|
||||
|
||||
poolBlocks_InitTemplate(ranOnce, displayedChart, xhrGetBlocks)
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user