Commit 41bbf653 authored by Seve's avatar Seve Committed by JC Brand

Handle cases where hint is not supplied.

parent 934e5ad4
...@@ -222,7 +222,8 @@ ...@@ -222,7 +222,8 @@
console.log(msg); console.log(msg);
//Spoiler logic //Spoiler logic
if ('spoiler' in attrs) { //The value of the "spoiler" attribute, corresponds to the spoiler's hint.
if ("spoiler" in attrs) {
console.log('Spoiler in attrs \n'); console.log('Spoiler in attrs \n');
let button = document.createElement("button"); let button = document.createElement("button");
let container = document.createElement("div"); let container = document.createElement("div");
...@@ -231,7 +232,6 @@ ...@@ -231,7 +232,6 @@
let contentHidden = document.createElement("div"); let contentHidden = document.createElement("div");
let messageContent = msg.querySelector(".chat-msg-content"); let messageContent = msg.querySelector(".chat-msg-content");
attrs.spoiler = attrs.spoiler == true ? _('Spoiler') : attrs.spoiler; //Check if attrs.spoiler can be true
hint.appendChild(document.createTextNode(attrs.spoiler)); hint.appendChild(document.createTextNode(attrs.spoiler));
for (var i = 0; i < messageContent.childNodes.length; i++){ for (var i = 0; i < messageContent.childNodes.length; i++){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment