From 0b6ca72dfc3bf87e098008125cfacfa9677b618c Mon Sep 17 00:00:00 2001 From: Lars van Hijfte Date: Mon, 30 Jan 2017 16:00:16 +0100 Subject: [PATCH] Fixed chat date not showing --- website/public/js/chat.js | 11 ++++++++++- website/public/styles/chat.css | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/website/public/js/chat.js b/website/public/js/chat.js index 014d723..e35f85c 100644 --- a/website/public/js/chat.js +++ b/website/public/js/chat.js @@ -54,16 +54,25 @@ function addMessages(messages) { type = "chat-message-other"; } if (i == 0) { + if (thisDate > previousDate) { + previousDate = thisDate; + messagesText += '\ +
\ +
\ + ' + days[thisDate.getDay()] + " " + thisDate.getDate() + " " + months[thisDate.getMonth()] + " " + thisDate.getFullYear() + '\ +
\ +
'; + } messagesText += '
'; } else if (type != previousType || thisTime != previousTime || thisDate > previousDate) { messagesText += '
\ ' + thisTime + '\
'; - previousDate = thisDate; previousTime = thisTime; previousType = type; if (thisDate > previousDate) { + previousDate = thisDate; messagesText += '\
\
\ diff --git a/website/public/styles/chat.css b/website/public/styles/chat.css index 47b0639..85eb219 100644 --- a/website/public/styles/chat.css +++ b/website/public/styles/chat.css @@ -144,4 +144,10 @@ body { .chat-message-other .chat-time { text-align: right; +} + +@media only screen and (max-width: 1200px) { + .chat-message-self, .chat-message-other { + max-width: 75%; + } } \ No newline at end of file