Skip to content

Commit

Permalink
clean sticky-alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Jan 27, 2024
1 parent d6d2002 commit 471c062
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,10 @@
styleIndex = 0
}
const isViewportWidthLessThan1234px = window.innerWidth < 1234
if (isViewportWidthLessThan1234px) {
const alerts = document.querySelectorAll(".sticky-alerts .alert");
if (alerts) {
for (let i = alerts.length - 1; i > 1; i--) {
alerts[i].remove();
}
const alerts = document.querySelectorAll(".sticky-alerts .alert");
if (alerts) {
for (let i = alerts.length - 1; i > (isViewportWidthLessThan1234px ? 1 : 10); i--) {
alerts[i].remove();
}
}
halfmoon.initStickyAlert({
Expand Down

0 comments on commit 471c062

Please sign in to comment.