Skip to content

Commit

Permalink
Add version selector, close #68
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Mar 15, 2019
1 parent 379e528 commit 72a2787
Show file tree
Hide file tree
Showing 6 changed files with 1,706 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions index.html
Expand Up @@ -89,6 +89,13 @@
</div>
</div>

<div class="version-selector">
Version:
<select id="version">
<option value="8.x" selected>8.x</option>
<option value="7.x">7.x</option>
</select>
</div>
</nav>

<header>
Expand Down
18 changes: 15 additions & 3 deletions src/app.js
Expand Up @@ -140,7 +140,7 @@ $('.paypal').onclick = () => {
return false
}

$('.cryptocurrencies').onclick = () => {
$('.cryptocurrencies') && $('.cryptocurrencies').addEventListener('click', (e) => {
const wallets = {
bitcoin: '12BxefvPMtHePgfPRDL1SaZYSG4GwQmWoP',
ethereum: '0x36e2b10666e2c0dc343901895ba3697b5d3214d1',
Expand Down Expand Up @@ -173,8 +173,8 @@ $('.cryptocurrencies').onclick = () => {
}
})

return false
}
e.preventDefault()
})

$('.examples .message button').onclick = () => {
Swal.fire('Any fool can use a computer')
Expand Down Expand Up @@ -749,6 +749,18 @@ Array.from(document.querySelectorAll('pre.code-sample')).forEach(pre => {
})
})

// Version selector
$('#version').addEventListener('change', () => {
switch ($('#version').value) {
case '7.x':
window.location.assign('v7.html')
break
default:
window.location.assign('/')
break
}
})

// BuySellAdd native.js (fixed footer)
_native.init('CK7DKKQI', {
targetClass: 'native-js'
Expand Down
4 changes: 4 additions & 0 deletions styles/styles.css
Expand Up @@ -87,6 +87,10 @@ nav {
opacity: .8; }
nav .share-the-love .social-buttons > *:hover {
opacity: 1; }
nav .version-selector {
margin: 2em 0 0 .6em;
text-align: left;
font-size: 1.1em; }

header {
max-width: 40.625rem;
Expand Down
6 changes: 6 additions & 0 deletions styles/styles.scss
Expand Up @@ -107,6 +107,12 @@ nav {
}
}
}

.version-selector {
margin: 2em 0 0 .6em;
text-align: left;
font-size: 1.1em;
}
}

header {
Expand Down

0 comments on commit 72a2787

Please sign in to comment.