From 00989e9c9ae62274e4017004501780bc581b41d9 Mon Sep 17 00:00:00 2001 From: andri lim Date: Sat, 16 Feb 2019 18:46:08 +0700 Subject: [PATCH] premix report page: chunked table cell using monospace font --- premix/assets/js/index.js | 11 ++++++++--- premix/index.html | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/premix/assets/js/index.js b/premix/assets/js/index.js index 5205cea4c..3f0051156 100644 --- a/premix/assets/js/index.js +++ b/premix/assets/js/index.js @@ -23,6 +23,13 @@ var premix = function() { } } + function renderCells(row, cls, cells) { + for(var text of cells) { + let cell = $(`${split32(text)}`).appendTo(row); + if(text.length > 32) cell.addClass('tm-monospace-cell'); + } + } + return { fields: ['op', 'pc', 'gas', 'gasCost', 'depth'], @@ -37,9 +44,7 @@ var premix = function() { let ncr = nimbus instanceof Object ? nimbus[x].toString().toLowerCase() : nimbus; let gcr = geth instanceof Object ? geth[x].toString().toLowerCase() : geth; let cls = ncr == gcr ? '' : 'class="uk-text-danger"'; - $(`${split32(x)}`).appendTo(row); - $(`${split32(ncr)}`).appendTo(row); - $(`${split32(gcr)}`).appendTo(row); + renderCells(row, cls, [x, ncr, gcr]); }, newSection: function(container, title, colored) { diff --git a/premix/index.html b/premix/index.html index 08ad83e1f..e78b9f7d4 100644 --- a/premix/index.html +++ b/premix/index.html @@ -22,6 +22,10 @@ overflow-y: auto; padding-left:40px; } + .tm-monospace-cell { + font-family: "Courier New", Courier, monospace; + font-weight: 500; + } .uk-nav-default > li > a.tm-text-danger { color: #f0506e; }