Merge pull request #677 from bitcoin/walletnocategory

Display no category by default on the wallet page
This commit is contained in:
saivann 2014-12-15 15:00:49 -05:00
commit 599218d5ae
2 changed files with 18 additions and 7 deletions

View file

@ -688,7 +688,7 @@ wallets:
<div class="wallets walletsmobile" id="walletsmobile"></div> <div class="wallets walletsmobile" id="walletsmobile"></div>
<script>if(isMobile())walletShowPlatform('mobile');else walletShowPlatform('desktop');</script> <script>if (isMobile()) walletShowPlatform('mobile'); else walletShowPlatform('default');</script>
<div class="walletsdisclaimer"> <div class="walletsdisclaimer">
<h2><img src="/img/icons/warning.svg" class="warningicon" alt="warning">{% translate educate %}</h2> <h2><img src="/img/icons/warning.svg" class="warningicon" alt="warning">{% translate educate %}</h2>

View file

@ -527,9 +527,11 @@ for (var i = 0, nds = document.getElementById('walletmenu').getElementsByTagName
nds[i].removeAttribute('data-active'); nds[i].removeAttribute('data-active');
removeClass(nds[i].parentNode, 'active'); removeClass(nds[i].parentNode, 'active');
} }
t.setAttribute('data-active', '1'); if (platform != 'default') {
addClass(t.parentNode, 'active'); t.setAttribute('data-active', '1');
if (t.parentNode.parentNode.parentNode.nodeName == 'LI') addClass(t.parentNode.parentNode.parentNode, 'active'); addClass(t.parentNode, 'active');
if (t.parentNode.parentNode.parentNode.nodeName == 'LI') addClass(t.parentNode.parentNode.parentNode, 'active');
}
// Replace wallets by those for given platform and rotate. // Replace wallets by those for given platform and rotate.
var p = document.getElementById('wallets'); var p = document.getElementById('wallets');
var ti = 200; var ti = 200;
@ -542,9 +544,18 @@ p.setAttribute('timeout', setTimeout(function() {
if (nds[i].nodeType != 1) continue; if (nds[i].nodeType != 1) continue;
var id = nds[i].id.split('-')[1]; var id = nds[i].id.split('-')[1];
if (document.getElementById('wallet-' + id)) continue; if (document.getElementById('wallet-' + id)) continue;
var nd = null;
if (platform == 'default') {
var defpl = ['desktop', 'mobile'];
for (var ii = 0, nn = defpl.length; ii < nn; ii++) {
if (document.getElementById('wallet-' + id + '-' + defpl[ii])) var nd = document.getElementById('wallet-' + id + '-' + defpl[ii]);
}
}
else {
if (document.getElementById('wallet-' + id + '-' + platform)) var nd = document.getElementById('wallet-' + id + '-' + platform); if (document.getElementById('wallet-' + id + '-' + platform)) var nd = document.getElementById('wallet-' + id + '-' + platform);
else if (document.getElementById('wallet-' + id + '-' + fallback) && document.getElementById('wallet-' + id + '-' + fallback).getAttribute('data-walletcompat').indexOf(platform) !== -1) var nd = document.getElementById('wallet-' + id + '-' + fallback); else if (document.getElementById('wallet-' + id + '-' + fallback) && document.getElementById('wallet-' + id + '-' + fallback).getAttribute('data-walletcompat').indexOf(platform) !== -1) var nd = document.getElementById('wallet-' + id + '-' + fallback);
else continue; }
if (nd === null) continue;
nd = nd.cloneNode(true); nd = nd.cloneNode(true);
nd.id = 'wallet-' + id; nd.id = 'wallet-' + id;
addClass(nd, 'nohover'); addClass(nd, 'nohover');