tryna fix new_comment_count

master
Aevann1 2022-09-08 21:08:42 +02:00
parent 1ce1410268
commit 90551bc143
3 changed files with 11 additions and 12 deletions

View File

@ -210,7 +210,7 @@
<script> <script>
if (!("standalone" in window.navigator) && !(window.navigator.standalone)) { if (!("standalone" in window.navigator) && !(window.navigator.standalone)) {
if (window.innerWidth <= 737) { if (window.innerWidth <= 737) {
window.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
const tt = bootstrap.Tooltip.getOrCreateInstance(document.getElementById('mobile-prompt')) const tt = bootstrap.Tooltip.getOrCreateInstance(document.getElementById('mobile-prompt'))
tt.show() tt.show()
document.getElementsByClassName('tooltip')[0].onclick = function(event){ document.getElementsByClassName('tooltip')[0].onclick = function(event){

View File

@ -1126,11 +1126,8 @@
<script> <script>
(() => { (() => {
{% if not v or v.highlightcomments %} {% if not v or v.highlightcomments %}
window.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
showNewCommentCounts('{{p.id}}', {{p.comment_count}}) showNewCommentCounts('{{p.id}}', {{p.comment_count}})
})
{% endif %}
{% if "?context" not in request.full_path %} {% if "?context" not in request.full_path %}
localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts")) localStorage.setItem("old-comment-counts", localStorage.getItem("comment-counts"))
@ -1139,6 +1136,8 @@
comments['{{p.id}}'] = {c: newTotal, t: Date.now()} comments['{{p.id}}'] = {c: newTotal, t: Date.now()}
localStorage.setItem("comment-counts", JSON.stringify(comments)) localStorage.setItem("comment-counts", JSON.stringify(comments))
{% endif %} {% endif %}
})
{% endif %}
})() })()
</script> </script>

View File

@ -306,7 +306,7 @@
<script> <script>
{% if not v or v.highlightcomments %} {% if not v or v.highlightcomments %}
window.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
showNewCommentCounts({{p.id}}, {{p.comment_count}}) showNewCommentCounts({{p.id}}, {{p.comment_count}})
}) })
{% endif %} {% endif %}