From bac91842f5e296aa213ca8d25c87ec1b567352bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Moreno?= Date: Sat, 23 Feb 2019 13:37:05 +0100 Subject: [PATCH] Fixed wallet dropdown Fixed wallet dropdown issue caused by Bootstrap popover and popper.js bug --- src/js/ui/walletDropdownRenderer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/ui/walletDropdownRenderer.js b/src/js/ui/walletDropdownRenderer.js index eb2a113..840e256 100644 --- a/src/js/ui/walletDropdownRenderer.js +++ b/src/js/ui/walletDropdownRenderer.js @@ -41,7 +41,7 @@ function getDropdownContents() { if (isDisabled) { $wallet.addClass('text-muted') } else { - $wallet.addClass('list-group-item-action').attr('data-index', index) + $wallet.addClass('list-group-item-action').attr('id', `wallet-${index}`) } $elem.append($wallet) }) @@ -110,8 +110,8 @@ $dropdown.popover({ }) // Attach dropdown listeners -$('body').on('click', '.wallet-dropdown-popover a[data-index]', function() { - const index = $(this).data('index') +$('body').on('mousedown', '.wallet-dropdown-popover a[id]', function() { + const index = Number($(this).attr('id').split('-')[1]) requestChangeWallet(index) }).on('refreshUi', $dropdown, function() { renderDropdownStatus()