Skip to content

Commit 9214064

Browse files
author
Joe-Brady
committed
Add toggling to Latest page platform drop-down
1 parent a75d068 commit 9214064

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/js/releases.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,21 @@ function selectLatestPlatform(thisPlatform) {
132132
var platformButtons = document.getElementById("latest-selector").getElementsByTagName("TD");
133133
var platformInfoBoxes = document.getElementById("latest-info").getElementsByTagName("TD");
134134

135+
var thisPlatformSelector = document.getElementById("latest-selector-" + thisPlatform);
136+
var thisPlatformInfo = document.getElementById("latest-info-" + thisPlatform);
137+
138+
var alreadySelected = false;
139+
if(thisPlatformSelector.classList.contains("latest-highlight")) {
140+
alreadySelected = true;
141+
}
142+
135143
for (i = 0; i < platformButtons.length; i++) {
136144
platformButtons[i].classList.remove("latest-highlight");
137145
platformInfoBoxes[i].classList.add("hide");
138146
}
139147

140-
var thisPlatformSelector = document.getElementById("latest-selector-" + thisPlatform);
141-
var thisPlatformInfo = document.getElementById("latest-info-" + thisPlatform);
142-
143-
thisPlatformSelector.classList.add("latest-highlight");
144-
thisPlatformInfo.classList.remove("hide");
148+
if(alreadySelected === false) {
149+
thisPlatformSelector.classList.add("latest-highlight");
150+
thisPlatformInfo.classList.remove("hide");
151+
}
145152
}

0 commit comments

Comments
 (0)