Skip to content

Commit c16b3c3

Browse files
authored
Merge pull request #113 from Joe-Brady/general
Nightly search bar location, text changed (Fixes #99), & Latest info toggling
2 parents fe6265f + 9214064 commit c16b3c3

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/handlebars/nightly.handlebars

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
</div>
2020
</a>
2121

22-
<input type="text" style="margin-top: 2rem;" class="block margin-auto" id="search" placeholder="Type to search">
23-
2422
<div style="margin-top: 1rem;">
2523
<span>View</span>
2624
<select id="numberpicker">
@@ -33,6 +31,8 @@
3331
<input type="text" id="datepicker" style="margin-top: 0.5rem;">
3432
</div>
3533

34+
<input type="text" style="margin-top: 1.5rem;" class="block margin-auto" id="search" placeholder="Search these builds">
35+
3636
<h3 id="scroll-text" class="hide" style="margin: 2rem 0 0 0;">Scroll horizontally <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></h3>
3737

3838
<div id="search-error" class="hide">No search results</div>

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)