Merge pull request #2563 from poanetwork/fix-view-less-transfers
Fix view less transfers buttonpull/2497/head
commit
35ab695c4d
@ -1,20 +1,17 @@ |
|||||||
import $ from 'jquery' |
import $ from 'jquery' |
||||||
|
|
||||||
const tokenTransferToggle = (element) => { |
$(document.body).on('click', '[data-selector="token-transfer-open"]', event => { |
||||||
const $element = $(element) |
const $tokenTransferOpen = event.target |
||||||
const $tokenTransferClose = $element.find("[data-selector='token-transfer-close']") |
const $parent = $tokenTransferOpen.parentElement |
||||||
const $tokenTransferOpen = $element.find("[data-selector='token-transfer-open']") |
const $tokenTransferClose = $parent.querySelector("[data-selector='token-transfer-close']") |
||||||
|
$tokenTransferOpen.classList.add('d-none') |
||||||
|
$tokenTransferClose.classList.remove('d-none') |
||||||
|
}) |
||||||
|
|
||||||
$element.on('show.bs.collapse', () => { |
$(document.body).on('click', '[data-selector="token-transfer-close"]', event => { |
||||||
$tokenTransferOpen.addClass('d-none') |
const $tokenTransferClose = event.target |
||||||
$tokenTransferClose.removeClass('d-none') |
const $parent = $tokenTransferClose.parentElement |
||||||
}) |
const $tokenTransferOpen = $parent.querySelector("[data-selector='token-transfer-open']") |
||||||
|
$tokenTransferClose.classList.add('d-none') |
||||||
$element.on('hide.bs.collapse', () => { |
$tokenTransferOpen.classList.remove('d-none') |
||||||
$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)) |
|
||||||
|
Loading…
Reference in new issue