open the reply box with .append() instead of tweaking outerHTML
authorArt Cancro <ajc@citadel.org>
Mon, 13 Dec 2021 20:18:54 +0000 (15:18 -0500)
committerArt Cancro <ajc@citadel.org>
Mon, 13 Dec 2021 20:18:54 +0000 (15:18 -0500)
webcit-ng/static/js/view_forum.js

index 791976b13e332864aae5e6c785884723197f2b62..b804702bc63adf11b748283a101ed97993dcf1f7 100644 (file)
@@ -209,8 +209,10 @@ function compose_references(references, msgid) {
 
 // Open a reply box directly below a specific message
 function open_reply_box(prefix, msgnum, is_quoted, references, msgid) {
-       new_div_name = prefix + "reply_to_" + msgnum;
-       document.getElementById(prefix+msgnum).outerHTML += "<div id=\"" + new_div_name + "\">reply box put here</div>";
+       let new_div = document.createElement("div");
+       let new_div_name = prefix + "reply_to_" + msgnum;
+       new_div.id = new_div_name;
+       document.getElementById(prefix+msgnum).append(new_div);
 
        replybox =
          "<div class=\"ctdl-msg-wrapper ctdl-msg-reply\">"             // begin message wrapper