Modify WebUI documentation link to open docs for the current version.

This commit is contained in:
Cody Soyland 2017-09-19 14:46:18 -05:00
parent e64eab5703
commit 1c5d08b14c

View file

@ -253,7 +253,12 @@ function populate_version() {
var node = document.getElementById('server-version')
xhr.onload = function() {
version = JSON.parse(xhr.responseText)['version']
var version = JSON.parse(xhr.responseText)['version']
var version_major_minor = /(v\d+\.\d+)/.exec(version)[0]
var doc_link = document.getElementById('nav-documentation')
doc_link.onclick = function() {
window.open('https://www.pilosa.com/docs/' + version_major_minor + '/introduction/')
}
node.innerHTML = version
}
xhr.send(null)