Commit 7a628aee6fa35bfb4935e55269eb4b431013c417
1 parent
ae6c1839
Exists in
master
and in
2 other branches
Chat javascript adjusts
Showing
1 changed file
with
17 additions
and
1 deletions
Show diff stats
amadeus/static/js/chat.js
... | ... | @@ -53,6 +53,12 @@ function getModalInfo(btn, space, space_type) { |
53 | 53 | $(this).animate({scrollTop: height}, 0); |
54 | 54 | }); |
55 | 55 | |
56 | + $(".messages-container").on('scroll', function () { | |
57 | + if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { | |
58 | + $('.messages_new').hide(); | |
59 | + } | |
60 | + }); | |
61 | + | |
56 | 62 | setShortChatFormSubmit(); |
57 | 63 | setFiltersSubmitAndPagination(); |
58 | 64 | } else { |
... | ... | @@ -63,6 +69,12 @@ function getModalInfo(btn, space, space_type) { |
63 | 69 | $(this).animate({scrollTop: height}, 0); |
64 | 70 | }); |
65 | 71 | |
72 | + $(".messages-container").on('scroll', function () { | |
73 | + if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) { | |
74 | + $('.messages_new').hide(); | |
75 | + } | |
76 | + }); | |
77 | + | |
66 | 78 | setShortChatFormSubmit(); |
67 | 79 | setFiltersSubmitAndPagination(); |
68 | 80 | }); |
... | ... | @@ -73,6 +85,10 @@ function getModalInfo(btn, space, space_type) { |
73 | 85 | }); |
74 | 86 | |
75 | 87 | $("#msg_editable").on('focusin', function () { |
88 | + $(".msg_placeholder").hide(); | |
89 | + }); | |
90 | + | |
91 | + $("#msg_editable").on('keydown', function () { | |
76 | 92 | $("#send-img").hide(); |
77 | 93 | $("#send-msg").show(); |
78 | 94 | |
... | ... | @@ -227,7 +243,7 @@ function setShortChatFormSubmit() { |
227 | 243 | new_msgs[data.talk_id].push(data.new_id); |
228 | 244 | |
229 | 245 | editable.html(""); |
230 | - editable.trigger("focusout"); | |
246 | + editable.blur(); | |
231 | 247 | |
232 | 248 | frm.attr('action', data.new_form_url); |
233 | 249 | $("#send-img").data('url', data.new_form_url); | ... | ... |