U <comment> v XML lze mít více <text>

fix #3 @1h
This commit is contained in:
2021-01-30 20:26:04 +01:00
parent b9c668841d
commit b3836d47a6
5 changed files with 49 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ class View {
); */
}
drawCommentsText(comments) {
drawCommentTittles(comments) {
let aside = document.getElementsByTagName("aside")[0];
for (let i = 0; i < comments.length; i++) {
@@ -49,11 +49,11 @@ class View {
comment.appendChild(time);
let commentText = document.createElement("div");
commentText.setAttribute("class", "commentText");
commentText.innerHTML = comments[i].text;
let commentTittle = document.createElement("div");
commentTittle.setAttribute("class", "commentText");
commentTittle.innerHTML = comments[i].tittle;
comment.appendChild(commentText);
comment.appendChild(commentTittle);
aside.appendChild(comment);
@@ -120,7 +120,14 @@ class View {
activateCommentText(text) {
let textArea = document.getElementsByTagName("article")[0];
textArea.innerHTML = text;
if (text == null) {
textArea.innerHTML = text;
return;
}
let div = document.createElement("div");
div.innerHTML = text;
textArea.append(div);
}
commentHover(c, active = true) {