rohan13 commited on
Commit
043dbf5
·
1 Parent(s): a949edc

widget minimizing

Browse files
Files changed (1) hide show
  1. static/chatbot.js +9 -7
static/chatbot.js CHANGED
@@ -1,11 +1,13 @@
1
  $(document).ready(function() {
2
  // Initialize variables
3
- var $messages = $('.chat-messages');
 
 
 
4
  var $input = $('.chat-input input');
5
  var $submit = $('.chat_submit');
6
- var $chatContainer = $('.chat-container');
7
  var session_id = '';
8
- $messages.children().each(function() {
9
  $(this).addClass('chat-message');
10
  });
11
 
@@ -29,10 +31,10 @@ $(document).ready(function() {
29
  } else {
30
  $message.addClass('bot')
31
  }
32
- if ($messages) {
33
- $messages.append($message);
34
- if ($messages[0]) {
35
- $messages.animate({scrollTop: $messages[0].scrollHeight}, 300);
36
  }
37
  } else {
38
  $('.chat-container').append($message);
 
1
  $(document).ready(function() {
2
  // Initialize variables
3
+ var $chatContainer = $('.chat-container');
4
+ var $chatHeader = $('.chat-header');
5
+ var $chatBody = $('.chat-body');
6
+ var $chatInput = $('.chat-input');
7
  var $input = $('.chat-input input');
8
  var $submit = $('.chat_submit');
 
9
  var session_id = '';
10
+ $chatBody.children().each(function() {
11
  $(this).addClass('chat-message');
12
  });
13
 
 
31
  } else {
32
  $message.addClass('bot')
33
  }
34
+ if ($chatBody) {
35
+ $chatBody.append($message);
36
+ if ($chatBody[0]) {
37
+ $chatBody.animate({scrollTop: $chatBody[0].scrollHeight}, 300);
38
  }
39
  } else {
40
  $('.chat-container').append($message);