Skip to content

Commit

Permalink
fix: version filter should be a <select> (#32)
Browse files Browse the repository at this point in the history
* fix: version filter should be a <select>

* fix: change window.location.search instead
  • Loading branch information
codebytere authored Dec 14, 2023
1 parent e837e20 commit 3696bba
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/static/css/releases.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@
box-shadow: var(--shadow-elevation-medium);
}

#version-select {
border: 1px solid whitesmoke;
padding: 5px;
border-radius: 5px;
margin: 10px;
font-size: 20px;
font-weight: bolder;
color: var(--electron-color-dark);
}

.releases__filter--selected {
border: 1px solid whitesmoke;
border-left: 6px solid var(--electron-color-light);
Expand Down
23 changes: 15 additions & 8 deletions src/views/releases.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
</div>
</a>
</div>
</div>
<div class="release-filter">
<strong>Filter by major release</strong>
<div>
<a href="?">All</a>
{{#each majors}}
<a href="?version={{this}}" {{#ifEquals this ../major}}class="selected-release-filter"{{/ifEquals}}>{{this}}.x</a>
{{/each}}
<div class="release-version-selector-container">
<select id="version-select" onchange="showSelectedVersion()">
<option value="All">All</option>
{{#each majors}}
<option value="{{this}}" {{#ifEquals this ../major}}selected{{/ifEquals}}>{{this}}.x</option>
{{/each}}
</select>
</div>
</div>
</div>
Expand All @@ -41,6 +41,13 @@
</article>
{{/each}}
</div>

</div>

<script>
function showSelectedVersion() {
const { value: version } = document.getElementById("version-select");
window.location.search = version === 'All' ? '' : `version=${version}`;
}
</script>

{{{paginate this.pages this.page this.prev this.next this.first this.last}}}

0 comments on commit 3696bba

Please sign in to comment.