From a1404ef6288bf97eb50bad247d70cad0ccee2af9 Mon Sep 17 00:00:00 2001 From: Renard Date: Wed, 3 Apr 2019 15:50:25 -0300 Subject: Shobon: Fix botón marcar mensajes como leidos --- static/js/shobon.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'static') diff --git a/static/js/shobon.js b/static/js/shobon.js index 31fab9a..3d549d0 100644 --- a/static/js/shobon.js +++ b/static/js/shobon.js @@ -60,7 +60,7 @@ function shobon() { if (isNewReply) { newRepliesCounter++; newRepliesInThread++; - reply.children[0].innerHTML += " NUEVO!"; + reply.children[0].innerHTML += " Nuevo!"; } } @@ -88,7 +88,7 @@ function shobon() { } if (newRepliesInThread > 0 && !inThread) { - thread.getElementsByClassName("threadlinks")[0].innerHTML += "Marcar como leido"; + thread.getElementsByClassName("threadlinks")[0].innerHTML += "Marcar como leido"; } } @@ -103,6 +103,16 @@ function shobon() { if(localStorage.getItem("shobon_newposts") == "true" && inThread) { localStorage.setItem(boardName + "_" + threadId, lastReplyN); } + + var btns = document.getElementsByClassName("btnMarkAsRead"); + for (var i = 0; i < btns.length; i++){ + btns[i].addEventListener("click", markAsRead, false); + } +} + +function markAsRead(){ + this.style.display = none; + localStorage.setItem(this.dataset.id, this.dataset.last); } function on_checked(e) { -- cgit v1.2.1-18-gbd029