remove unnecessary arrow functions

master
Aevann1 2022-11-18 21:34:38 +02:00
parent 446ef58c2c
commit b4448ae926
2 changed files with 12 additions and 16 deletions

View File

@ -180,7 +180,6 @@ function smoothScrollTop()
}
// Click navbar to scroll back to top
(() => {
for (const i of document.querySelectorAll('nav'))
{
i.addEventListener('click', (e) => {
@ -192,7 +191,6 @@ function smoothScrollTop()
smoothScrollTop();
}, false);
}
})();
// Dynamic shadow when the user scrolls
document.addEventListener('scroll',function (event) {

View File

@ -569,21 +569,19 @@
{% endif %}
<script>
(() => {
{% if not v or v.highlightcomments %}
document.addEventListener('DOMContentLoaded', function() {
showNewCommentCounts('{{p.id}}', {{p.comment_count}})
{% if "?context" not in request.full_path %}
localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts"))
{% if not v or v.highlightcomments %}
document.addEventListener('DOMContentLoaded', function() {
showNewCommentCounts('{{p.id}}', {{p.comment_count}})
{% if "?context" not in request.full_path %}
localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts"))
const comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || {c: 0}).c + 1)
comments['{{p.id}}'] = {c: newTotal, t: Date.now()}
localStorage.setItem("comment-counts", JSON.stringify(comments))
{% endif %}
})
{% endif %}
})()
const comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || {c: 0}).c + 1)
comments['{{p.id}}'] = {c: newTotal, t: Date.now()}
localStorage.setItem("comment-counts", JSON.stringify(comments))
{% endif %}
})
{% endif %}
</script>
{% if success %}