From 830c30ae6afb20f3f7ba4225cb9a2afa152833a0 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 27 Jun 2019 14:45:24 +0300 Subject: [PATCH] hide csv button if there are no transactions --- apps/block_scout_web/assets/js/lib/async_listing_load.js | 8 ++++++++ .../templates/address_transaction/index.html.eex | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/async_listing_load.js b/apps/block_scout_web/assets/js/lib/async_listing_load.js index 3a3eb2fd6c..8610d901f6 100644 --- a/apps/block_scout_web/assets/js/lib/async_listing_load.js +++ b/apps/block_scout_web/assets/js/lib/async_listing_load.js @@ -219,6 +219,14 @@ export const elements = { $el.hide() } + }, + '[csv-download]': { + render ($el, state) { + if (state.emptyResponse) { + return $el.hide() + } + return $el.show() + } } } diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex index a24df921c6..3750c772cd 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex @@ -50,8 +50,8 @@ - - + + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %> @@ -66,9 +66,9 @@
- +
-