_content/doc: always update install tab version numbers
Fixes golang/go#69603
Change-Id: I5dd8910dd7a6f9c758a8f755eeb544d2d95446dc
Reviewed-on: https://go-review.googlesource.com/c/website/+/620556
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
diff --git a/_content/doc/download.js b/_content/doc/download.js
index ef9efb4..9f2f9e0 100644
--- a/_content/doc/download.js
+++ b/_content/doc/download.js
@@ -24,12 +24,15 @@
this.linuxFileName = file;
}
}
+
+ this.setVersion(data[0].version);
+ this.tabs.forEach(el => this.setInstallTabData(el.id));
+
this.detectOS();
const osTab = document.getElementById(this.osName);
if (osTab !== null) {
osTab.click();
}
- this.setVersion(data[0].version);
})
.catch(console.error);
this.setEventListeners();
@@ -70,8 +73,6 @@
this.osName = 'linux';
} else if (navigator.userAgent.indexOf('Mac') !== -1) {
this.osName = 'mac';
- } else if (navigator.userAgent.indexOf('X11') !== -1) {
- this.osName = 'unix';
} else if (navigator.userAgent.indexOf('Win') !== -1) {
this.osName = 'windows';
}
@@ -93,7 +94,6 @@
handleTabClick(e) {
const el = (e.target);
this.activateTab(Array.prototype.indexOf.call(this.tabs, el));
- this.setInstallTabData(el.id);
}
// get version number.