Compare commits
No commits in common. "34c5b3519420626d9cd4ccf20dad2530dce95fda" and "e525120a151e42a5b06952e5cec3cc6c9c260dfd" have entirely different histories.
34c5b35194
...
e525120a15
13
main.js
13
main.js
@ -23,15 +23,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) {
|
||||||
|
|
||||||
@ -83,7 +74,7 @@ class Conversation {
|
|||||||
messageText = json.message;
|
messageText = json.message;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addMessage(new AgentMessage(messageText));
|
this.messages.push(new AgentMessage(messageText));
|
||||||
this.render();
|
this.render();
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -100,7 +91,7 @@ class Conversation {
|
|||||||
// this.render();
|
// this.render();
|
||||||
//}, 5000);
|
//}, 5000);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
this.addMessage(message);
|
this.messages.push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the current HTML based on messages
|
// update the current HTML based on messages
|
||||||
|
@ -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