Skip to content

Commit 9c2d188

Browse files
committed
update version select
1 parent c6c5919 commit 9c2d188

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

themes/vue/layout/partials/sidebar.ejs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
<h2>
1313
<%- type === 'api' ? 'API' : (type.charAt(0).toUpperCase() + type.slice(1)) %>
1414
<select class="version-select">
15-
<option value="rc">2.0-rc</option>
16-
<option selected>1.0</option>
17-
<option>0.12</option>
18-
<option>0.11</option>
15+
<option value="">2.0</option>
16+
<option selected value="SELF">1.0</option>
17+
<option value="012">0.12</option>
18+
<option value="011">0.11</option>
1919
</select>
2020
</h2>
2121
<ul class="menu-root">

themes/vue/source/js/common.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,9 @@
5454
// version select
5555
document.querySelector('.version-select').addEventListener('change', function (e) {
5656
var version = e.target.value
57-
if (version.indexOf('1.') !== 0) {
58-
version = version.replace('.', '')
57+
if (version !== 'SELF') {
5958
var section = window.location.pathname.match(/\/(\w+?)\//)[1]
60-
window.location.assign('http://' + version + '.vuejs.org/' + section + '/')
61-
} else {
62-
// TODO when 1.x is out
59+
window.location.assign('http://' + (version ? version + '.' : '') + 'vuejs.org/' + section + '/')
6360
}
6461
})
6562
}

0 commit comments

Comments
 (0)