Wallets: fix accidental wallet hiding on category change

Closes #1493

When a wallet was selected on mobile displays, its entry was copied to
another part of the page with its element id intact.  When a category
was changed, it prevented duplicate entries from being shown by
searching the page for matching ids, which unintentionally matched the
copied element.

This patch changes the id of the copied entry during the copy operation.
This commit is contained in:
David A. Harding 2017-05-10 15:01:46 -04:00
parent a702d178a0
commit 2dc026918a
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7

View file

@ -389,6 +389,7 @@ function walletListener(e) {
if (isMobile()) {
var p = document.getElementById('walletsmobile');
t = t.cloneNode(true);
t.id = 'inline_wallet_box';
p.innerHTML = '';
p.appendChild(t);
scrollToNode(p);
@ -467,6 +468,7 @@ function walletShowPlatform(platform) {
for (var i = 0, nds = document.getElementById('walletsswitch').childNodes, n = nds.length; i < n; i++) {
if (nds[i].nodeType !== 1) continue;
var id = nds[i].id.split('-')[1];
// for wallets with multiple listings, only show one instance per view
if (document.getElementById('wallet-' + id)) continue;
var nd = null;
for (var ii = 0, nn = platforms.length; ii < nn; ii++) {