Commit 67316707e7e59da753babc18538b090a9dfd05c7

Authored by Zambom
1 parent a81d1ce0

Adjusting chat first message filter problem

Showing 2 changed files with 6 additions and 1 deletions   Show diff stats
amadeus/static/js/chat.js
@@ -287,6 +287,8 @@ function setChatFormSubmit() { @@ -287,6 +287,8 @@ function setChatFormSubmit() {
287 var height = $(this)[0].scrollHeight; 287 var height = $(this)[0].scrollHeight;
288 288
289 $(this).animate({scrollTop: height}, 0); 289 $(this).animate({scrollTop: height}, 0);
  290 +
  291 + $(this).attr('data-url', data.load_msg_url);
290 }); 292 });
291 293
292 if (typeof(new_msgs[data.talk_id]) == 'undefined') { 294 if (typeof(new_msgs[data.talk_id]) == 'undefined') {
@@ -345,6 +347,8 @@ function setShortChatFormSubmit() { @@ -345,6 +347,8 @@ function setShortChatFormSubmit() {
345 var height = $(this)[0].scrollHeight; 347 var height = $(this)[0].scrollHeight;
346 348
347 $(this).animate({scrollTop: height}, 0); 349 $(this).animate({scrollTop: height}, 0);
  350 +
  351 + $(this).attr('data-url', data.load_msg_url);
348 }); 352 });
349 353
350 if (typeof(new_msgs[data.talk_id]) == 'undefined') { 354 if (typeof(new_msgs[data.talk_id]) == 'undefined') {
@@ -422,10 +422,11 @@ def render_message(request, talk_msg, talk_id, space, space_type, email): @@ -422,10 +422,11 @@ def render_message(request, talk_msg, talk_id, space, space_type, email):
422 context['talk_msg'] = msg 422 context['talk_msg'] = msg
423 423
424 form_url = reverse_lazy('chat:create', args = (), kwargs = {'email': email, 'talk_id': talk_id, 'space': space, 'space_type': space_type}) 424 form_url = reverse_lazy('chat:create', args = (), kwargs = {'email': email, 'talk_id': talk_id, 'space': space, 'space_type': space_type})
  425 + loading_msg = reverse_lazy('chat:load_messages', args = (msg.talk.id, ))
425 426
426 html = render_to_string("chat/_message.html", context, request) 427 html = render_to_string("chat/_message.html", context, request)
427 428
428 - return JsonResponse({'view': html, 'new_id': msg.id, 'talk_id': msg.talk.id, 'new_form_url': form_url}) 429 + return JsonResponse({'view': html, 'new_id': msg.id, 'talk_id': msg.talk.id, 'new_form_url': form_url, 'load_msg_url': loading_msg})
429 430
430 @login_required 431 @login_required
431 def favorite(request, message): 432 def favorite(request, message):