forked from rDrama/rDrama
remove unnecessary arrow functions
parent
446ef58c2c
commit
b4448ae926
|
@ -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) {
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue