Skip to content

Commit

Permalink
Add JavaScript items visibility utils
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Jul 7, 2024
1 parent 3292de2 commit 5eec42a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions frontend/src/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,6 @@

// Flavors
@import "flavor/ranks-flavors.less";

// Visibility overrides when JS is off
@import "misago/javascript.less";
10 changes: 10 additions & 0 deletions frontend/src/style/misago/javascript.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Utility classes for making content visible only when JS is available
.d-js-block,
.d-js-flex {
display: none;
}

.misago-javascript {
.d-js-block { display: block; }
.d-js-flex { display: flex; }
}
2 changes: 1 addition & 1 deletion misago/static/misago/css/misago.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/css/misago.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions misago/templates/misago/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
</script>
</head>
<body class="misago-{% if user.is_authenticated %}authenticated{% else %}anonymous{% endif %}{% if misago_agreement %} agreement-overlay-visible{% endif %}">
<script type="text/javascript">
document.body.classList.add("misago-javascript")
</script>
{% if settings.google_tracking_id %}
{% include "misago/analytics.html" %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion misago/templates/misago/threads/toolbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
</div>
{% if threads.filters and not bottom %}
<div class="toolbar-section">
<div class="toolbar-section d-js-flex">
<div class="toolbar-item">
{% include "misago/threads/filters_dropdown.html" with active_filter=threads.active_filter filters=threads.filters remove_filters_url=threads.remove_filters_url %}
</div>
Expand Down

0 comments on commit 5eec42a

Please sign in to comment.