Show raw data directly

pull/1282/head
fvictorio 6 years ago
parent e9e6d3444d
commit 27c57b62d3
  1. 12
      apps/block_scout_web/assets/css/components/_transaction-input.scss
  2. 1
      apps/block_scout_web/assets/js/app.js
  3. 21
      apps/block_scout_web/assets/js/lib/swappable_item.js
  4. 8
      apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex
  5. 17
      apps/block_scout_web/lib/block_scout_web/templates/transaction_log/index.html.eex

@ -1,15 +1,3 @@
.raw-transaction-input{
display: none;
}
.raw-transaction-log-topics{
display: none;
}
.raw-transaction-log-data{
display: none;
}
.transaction-input-text{
white-space: pre;
color: black;

@ -50,4 +50,3 @@ import './lib/token_transfers_toggle'
import './lib/async_listing_load'
import './lib/tooltip'
import './lib/try_api'
import './lib/swappable_item'

@ -1,21 +0,0 @@
import $ from 'jquery'
const swapItems = (element, event) => {
const $element = $(element)
const item = $element.parent().closest('[swappable-item]')
const next = item.nextAll('[swappable-item]:first')
item.hide()
if (next.length) {
next.show()
} else {
item.parent().find('[swappable-item]:first').show()
}
return false
}
$('[swappable-item] [swapper]').on('click', function (event) {
swapItems(this, event)
})

@ -79,13 +79,7 @@
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Raw Input" %></dt>
<dd class="col-sm-9">
<div swappable-item>
<button swapper class="button button-primary"><%= gettext "Show Raw Input"%></button>
</div>
<div swappable-item class="raw-transaction-input">
<button swapper type="button" class="close pr-2" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<div class="raw-transaction-input">
<button type="button" class="copy icon-link mb-1" data-toggle="tooltip" data-placement="top" data-clipboard-text="<%= @transaction.input %>" aria-label="Copy Value">
<i class="fas fa-clone"></i>
</button>

@ -87,13 +87,7 @@
</dd>
<dt class="col-md-1"><%= gettext "Topics" %></dt>
<dd class="col-md-11">
<div swappable-item>
<button swapper class="button button-primary"><%= gettext "Show Raw Topics"%></button>
</div>
<div swappable-item class="raw-transaction-log-topics">
<button swapper type="button" class="close pr-2" aria-label="<%= gettext "Close" %>">
<span aria-hidden="true">&times;</span>
</button>
<div class="raw-transaction-log-topics">
<%= unless is_nil(log.first_topic) do %>
<div class="text-dark">
<span class="text-dark">[0]</span>
@ -125,14 +119,7 @@
</dt>
<dd class="col-md-11">
<%= unless is_nil(log.data) do %>
<div swappable-item>
<button swapper class="button button-primary"><%= gettext "Show Raw Data"%></button>
</div>
<div swappable-item class="text-dark raw-transaction-log-data">
<button swapper type="button" class="close pr-2" aria-label="<%= gettext "Close" %>">
<span aria-hidden="true">&times;</span>
</button>
<div class="text-dark raw-transaction-log-data">
<%= log.data %>
</div>
<% end %>

Loading…
Cancel
Save