From a72a6e7e62c9c2944afc4ff27649490b4c385150 Mon Sep 17 00:00:00 2001 From: Domeniko Gentner Date: Wed, 2 Dec 2020 17:20:42 +0100 Subject: [PATCH] forgot the new css :P --- js/labertasche.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/js/labertasche.js b/js/labertasche.js index 74f5270..471fdb0 100644 --- a/js/labertasche.js +++ b/js/labertasche.js @@ -47,6 +47,30 @@ function labertasche_reply_callback() */ +function labertasche_reply_to(comment_id, callback) +{ + let comments = document.getElementById('labertasche-comment-section'); + if (comments){ + if (document.getElementById('labertasche-replied-to')){ + document.getElementById('labertasche-replied-to').remove(); + callback('off', comment_id); + if (comment_id === -1){ + return false; + } + } + let reply = document.createElement("input"); + reply.setAttribute("type", "text"); + reply.setAttribute("id", "labertasche-replied-to"); + reply.classList.add("is-hidden"); + reply.value = comment_id; + comments.appendChild(reply); + callback('on', comment_id); + } + else{ + console.log("Missing text input with id labertasche-comment-section"); + } +} + function labertasche_post_comment(btn, callback) { let remote = document.getElementById('labertasche-comment-section').dataset.remote;