DF theme: fix flickering at tx page

pull/3333/head
Victor Baranov 4 years ago
parent 35e1b62b81
commit eacb4c4888
  1. 17
      apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex

@ -45,6 +45,7 @@
darkForestContractAddressHashes.forEach(darkForestContractAddressHash => {
if (window.location.pathname.toLowerCase().includes(darkForestContractAddressHash)) {
document.body.className += " " + "dark-forest-theme-applied";
document.documentElement.className += " " + "dark-forest-theme-applied";
return;
}
})
@ -59,6 +60,22 @@
window.onload = applyDarkMode()
window.onload = applyCustomMode()
</script>
<%= cond do %>
<% (
@view_module == Elixir.BlockScoutWeb.TransactionView ||
@view_module == Elixir.BlockScoutWeb.TransactionInternalTransactionView ||
@view_module == Elixir.BlockScoutWeb.TransactionLogView ||
@view_module == Elixir.BlockScoutWeb.TransactionRawTraceView ||
@view_module == Elixir.BlockScoutWeb.TransactionTokenTransferView
) -> %>
<script>
if (document.getElementsByTagName("body")[0]) {
document.getElementsByTagName("body")[0].style.visibility = "hidden";
}
</script>
<% true -> %>
<%= nil %>
<% end %>
<div class="layout-container">
<%= if not Explorer.Chain.finished_indexing?() do %>
<div class="alert alert-warning text-center mb-0 p-3" data-selector="indexed-status">

@ -11,8 +11,10 @@
darkForestContractAddressHashes.forEach(darkForestContractAddressHash => {
if (to_address == darkForestContractAddressHash) {
document.body.className += " " + "dark-forest-theme-applied";
document.documentElement.className += " " + "dark-forest-theme-applied";
return;
}
document.getElementsByTagName("body")[0].style.visibility = "visible";
})
}
window.onload = applyCustomMode()

Loading…
Cancel
Save