From 82d6265024fa8c6fd0dd2c747b84a8a145858fd6 Mon Sep 17 00:00:00 2001 From: saneery Date: Tue, 13 Aug 2019 15:23:29 +0300 Subject: [PATCH 1/2] Toggle button view more/less transfers --- .../assets/js/lib/token_transfers_toggle.js | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/apps/block_scout_web/assets/js/lib/token_transfers_toggle.js b/apps/block_scout_web/assets/js/lib/token_transfers_toggle.js index af188ae550..b2f029c57d 100644 --- a/apps/block_scout_web/assets/js/lib/token_transfers_toggle.js +++ b/apps/block_scout_web/assets/js/lib/token_transfers_toggle.js @@ -1,20 +1,17 @@ import $ from 'jquery' -const tokenTransferToggle = (element) => { - const $element = $(element) - const $tokenTransferClose = $element.find("[data-selector='token-transfer-close']") - const $tokenTransferOpen = $element.find("[data-selector='token-transfer-open']") +$(document.body).on('click', '[data-selector="token-transfer-open"]', event => { + const $tokenTransferOpen = event.target + const $parent = $tokenTransferOpen.parentElement + const $tokenTransferClose = $parent.querySelector("[data-selector='token-transfer-close']") + $tokenTransferOpen.classList.add('d-none') + $tokenTransferClose.classList.remove('d-none') +}) - $element.on('show.bs.collapse', () => { - $tokenTransferOpen.addClass('d-none') - $tokenTransferClose.removeClass('d-none') - }) - - $element.on('hide.bs.collapse', () => { - $tokenTransferClose.addClass('d-none') - $tokenTransferOpen.removeClass('d-none') - }) -} - -// Initialize the script scoped for each card. -$("[data-selector='token-transfers-toggle']").each((_index, element) => tokenTransferToggle(element)) +$(document.body).on('click', '[data-selector="token-transfer-close"]', event => { + const $tokenTransferClose = event.target + const $parent = $tokenTransferClose.parentElement + const $tokenTransferOpen = $parent.querySelector("[data-selector='token-transfer-open']") + $tokenTransferClose.classList.add('d-none') + $tokenTransferOpen.classList.remove('d-none') +}) From b4cfcfabcdbbfa21559f579fff7e6793ae049a99 Mon Sep 17 00:00:00 2001 From: saneery Date: Tue, 13 Aug 2019 15:33:20 +0300 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ade434a9d7..8ad4e7715f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Features ### Fixes +- [#2563](https://github.com/poanetwork/blockscout/pull/2563) - Fix view less transfers button ### Chore