Merge pull request #833 from codysoyland/versioned-doc-link

Modify WebUI documentation link to open docs for the current version.
This commit is contained in:
Cody Soyland 2017-10-03 14:58:29 -05:00 committed by GitHub
commit 3677154000

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)