Skip to content

Commit

Permalink
Hide assets/examples filters to non-JS users (#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
doup authored Dec 10, 2024
1 parent 7c3c6b7 commit 4e9f048
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 2 additions & 0 deletions static/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ if (versionsSelect) {

}

document.querySelector('[data-assets-filters]').classList.remove('hidden');

document
.querySelector('#assets-filter')
.addEventListener("change", (item) => {
Expand Down
24 changes: 13 additions & 11 deletions templates/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
{% block page_content %}
<div class="assets">
{{ assets_macros::init_svg() }}
<div class="assets-search">
<input class="assets-search__input"
type="text"
id="assets-search"
placeholder="Search (ie: 0.11 MIT)">
</div>
<div class="assets-filters">
<label>Bevy last supported version</label>
<select class="asset-version-select" id="assets-filter">
<option value="all_versions">All</option>
</select>
<div class="hidden" data-assets-filters>
<div class="assets-search">
<input class="assets-search__input"
type="text"
id="assets-search"
placeholder="Search (ie: 0.15 MIT)">
</div>
<div class="assets-filters">
<label>Bevy last supported version</label>
<select class="asset-version-select" id="assets-filter">
<option value="all_versions">All</option>
</select>
</div>
</div>
<div class="assets-intro media-content">
A collection of third-party Bevy assets, plugins, learning resources, and apps made by the community. If you
Expand Down
4 changes: 2 additions & 2 deletions templates/layouts/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="assets-intro media-content">
{% block intro %}{% endblock intro %}
</div>
<div class="assets-search">
<div class="assets-search hidden" data-assets-filters>
<input class="assets-search__input"
type="text"
id="assets-search"
Expand All @@ -30,5 +30,5 @@ <h1 class="asset-section" id="{{ section.title | slugify }}">
{% endif %}
{% endfor %}
</div>
<script type="module">import '/assets.js'</script>
<script type="module">import '/assets.js';</script>
{% endblock page_content %}

0 comments on commit 4e9f048

Please sign in to comment.