Compare commits
7 Commits
18490df072
...
bf7a989b75
Author | SHA1 | Date | |
---|---|---|---|
bf7a989b75 | |||
56eb1067d1 | |||
52259b64f7 | |||
a9845b9296 | |||
5b1783a71e | |||
f4abc6dc90 | |||
a07e8b78c0 |
18
main.js
18
main.js
@ -24,15 +24,6 @@ class Conversation {
|
|||||||
this.messages = initialMessages;
|
this.messages = initialMessages;
|
||||||
}
|
}
|
||||||
|
|
||||||
addMessage(message) {
|
|
||||||
this.messages.push(message);
|
|
||||||
this.render();
|
|
||||||
|
|
||||||
var elements = document.getElementById("messages").children;
|
|
||||||
var lastElement = elements[elements.length - 1];
|
|
||||||
lastElement.scrollIntoView();
|
|
||||||
}
|
|
||||||
|
|
||||||
// for the user to send their own messages
|
// for the user to send their own messages
|
||||||
sendUserMessage(text) {
|
sendUserMessage(text) {
|
||||||
|
|
||||||
@ -85,7 +76,7 @@ class Conversation {
|
|||||||
messageText = json.message;
|
messageText = json.message;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
this.addMessage(new AgentMessage(messageText));
|
this.messages.push(new AgentMessage(messageText));
|
||||||
this.render();
|
this.render();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (score == 1) {
|
if (score == 1) {
|
||||||
@ -104,7 +95,12 @@ class Conversation {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.addMessage(message);
|
message.updateStatus("delivered");
|
||||||
|
this.render();
|
||||||
|
//setTimeout(() => {
|
||||||
|
// message.updateStatus("read");
|
||||||
|
// this.render();
|
||||||
|
//}, 5000);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,9 +72,6 @@ body {
|
|||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-panel {
|
|
||||||
width: calc(100% - 300px);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#side-panel .conversation {
|
#side-panel .conversation {
|
||||||
@ -108,7 +105,7 @@ body {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
width: 100%;
|
width: calc(100% - 300px);
|
||||||
}
|
}
|
||||||
|
|
||||||
#page {
|
#page {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user