mirror of
https://github.com/seigler/dash-visualizer
synced 2025-07-27 01:36:10 +00:00
feat: limit visualization to 100 elements
This commit is contained in:
parent
ffd6f7e41a
commit
3e6057e624
2 changed files with 10 additions and 0 deletions
9
app.js
9
app.js
|
@ -11,6 +11,7 @@
|
||||||
'tx': null,
|
'tx': null,
|
||||||
'block': null
|
'block': null
|
||||||
};
|
};
|
||||||
|
var domRefList = [];
|
||||||
window.addEventListener('load', init, false);
|
window.addEventListener('load', init, false);
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
@ -122,6 +123,10 @@
|
||||||
txOut.title = (value[Object.keys(value)[0]] * 0.00000001);
|
txOut.title = (value[Object.keys(value)[0]] * 0.00000001);
|
||||||
txOutputs.appendChild(txOut);
|
txOutputs.appendChild(txOut);
|
||||||
});
|
});
|
||||||
|
if (domRefList.unshift(tx) > 100) {
|
||||||
|
var toDelete = domRefList.pop();
|
||||||
|
toDelete.remove();
|
||||||
|
}
|
||||||
transactionList.insertBefore(tx, transactionList.firstChild);
|
transactionList.insertBefore(tx, transactionList.firstChild);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -134,6 +139,10 @@
|
||||||
newBlock.target = '_blank';
|
newBlock.target = '_blank';
|
||||||
newBlock.setAttribute('rel', 'noopener');
|
newBlock.setAttribute('rel', 'noopener');
|
||||||
newBlock.appendChild(document.createTextNode(data));
|
newBlock.appendChild(document.createTextNode(data));
|
||||||
|
if (domRefList.unshift(newBlock) > 100) {
|
||||||
|
var toDelete = domRefList.pop();
|
||||||
|
toDelete.remove();
|
||||||
|
}
|
||||||
transactionList.insertBefore(newBlock, transactionList.firstChild);
|
transactionList.insertBefore(newBlock, transactionList.firstChild);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ body {
|
||||||
background-color: hsl(208, 73%, 43%);
|
background-color: hsl(208, 73%, 43%);
|
||||||
color: white;
|
color: white;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
* {
|
* {
|
||||||
box-sizing: inherit;
|
box-sizing: inherit;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue