From 7a628aee6fa35bfb4935e55269eb4b431013c417 Mon Sep 17 00:00:00 2001 From: Zambom Date: Tue, 4 Apr 2017 22:05:16 -0300 Subject: [PATCH] Chat javascript adjusts --- amadeus/static/js/chat.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/amadeus/static/js/chat.js b/amadeus/static/js/chat.js index 1c51cf0..0cfc712 100644 --- a/amadeus/static/js/chat.js +++ b/amadeus/static/js/chat.js @@ -53,6 +53,12 @@ function getModalInfo(btn, space, space_type) { $(this).animate({scrollTop: height}, 0); }); + $(".messages-container").on('scroll', function () { + if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { + $('.messages_new').hide(); + } + }); + setShortChatFormSubmit(); setFiltersSubmitAndPagination(); } else { @@ -63,6 +69,12 @@ function getModalInfo(btn, space, space_type) { $(this).animate({scrollTop: height}, 0); }); + $(".messages-container").on('scroll', function () { + if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { + $('.messages_new').hide(); + } + }); + setShortChatFormSubmit(); setFiltersSubmitAndPagination(); }); @@ -73,6 +85,10 @@ function getModalInfo(btn, space, space_type) { }); $("#msg_editable").on('focusin', function () { + $(".msg_placeholder").hide(); + }); + + $("#msg_editable").on('keydown', function () { $("#send-img").hide(); $("#send-msg").show(); @@ -227,7 +243,7 @@ function setShortChatFormSubmit() { new_msgs[data.talk_id].push(data.new_id); editable.html(""); - editable.trigger("focusout"); + editable.blur(); frm.attr('action', data.new_form_url); $("#send-img").data('url', data.new_form_url); -- libgit2 0.21.2