forked from MarseyWorld/MarseyWorld
fix highlighting comments
parent
1495dbe5d4
commit
71f4797027
|
@ -4,8 +4,9 @@ function highlight_unread(localstoragevar) {
|
|||
lastCount = comments[pid]
|
||||
if (lastCount)
|
||||
{
|
||||
const comms = document.getElementById("comms").value
|
||||
for (const c of comms) {
|
||||
const comms = document.getElementById("comms").value.slice(0, -1).split(',')
|
||||
for (let c of comms) {
|
||||
c = c.split(':')
|
||||
if (c[1]*1000 > lastCount.t) {
|
||||
try {document.getElementById(`comment-${c[0]}-only`).classList.add('unread')}
|
||||
catch(e) {}
|
||||
|
|
|
@ -764,15 +764,7 @@
|
|||
|
||||
{% if p %}
|
||||
{% set pid = p.id %}
|
||||
<div class="d-none">
|
||||
{% set comms = [] %}
|
||||
{% for c in p.comments %}
|
||||
{% if not (v and v.id==c.author_id) and not c.voted %}
|
||||
{{comms.append([c.id, c.created_utc])}}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<input hidden id="comms" value="{{comms}}">
|
||||
</div>
|
||||
<input hidden id="comms" value="{% for c in p.comments %}{{c.id}}:{{c.created_utc}},{% endfor %}">
|
||||
{% endif %}
|
||||
|
||||
{% if offset %}
|
||||
|
|
Loading…
Reference in New Issue