[NewsUpdates] Stop links from being clickable when the news section is closed (#872)

This commit is contained in:
Cinder 2025-02-03 08:06:34 -08:00 committed by GitHub
parent 4548e9e452
commit 92125ea7be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 8 deletions

View File

@ -17,6 +17,8 @@ div#page div#news {
&.open {
max-height: none;
#news-body { pointer-events: unset; }
}
#news-header {
@ -26,26 +28,27 @@ div#page div#news {
cursor: pointer;
width: 100%;
text-align: center;
padding: 0.5rem 0.5rem 0;
padding: 0.5rem;
}
#news-body {
display: block;
box-sizing: border-box;
margin-top: 5px;
max-width: 800px;
padding: 0 0.5rem 0.5rem;
pointer-events: none;
}
#news-dismiss {
position: absolute;
right: 0.5rem;
top: 0.25rem;
right: 0;
top: 0;
padding: 0.25rem 1rem;
cursor: pointer;
font-size: 1.15rem;
font-size: 1.25rem;
font-weight: bold;
color: white;
}
}

View File

@ -1,8 +1,8 @@
<% if news_update.present? %>
<div class="ui-state-highlight site-notice" style="display: none;" id="news" data-id="<%= news_update.id %>">
<a href="" id="news-dismiss" title="Dismiss"><i class="fas fa-times"></i></a>
<a href="" role="button" id="news-dismiss" title="Dismiss"><i class="fas fa-times"></i></a>
<h6 id="news-header">News: <%= news_update.created_at.strftime("%b %d, %Y") %>
<a href="" id="news-show">Show</a>
<a href="" role="button" id="news-show">Show</a>
</h6>
<div id="news-body" class="dtext-container"><%= format_text(news_update.message) %></div>
</div>