Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/apps/block_scout_web/assets/js/lib/swappable_item.js

21 lines
443 B

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)
})