[Git][noosfero/noosfero][cherry-pick-e19703d8] Merge branch 'chat-label-counter' into 'master'
Rodrigo Souto
gitlab at mg.gitlab.com
Wed Feb 8 16:55:18 BRST 2017
Rodrigo Souto pushed to branch cherry-pick-e19703d8 at Noosfero / noosfero
Commits:
5916905b by Rodrigo Souto at 2017-02-08T18:55:15+00:00
Merge branch 'chat-label-counter' into 'master'
chat-label-counter: display counter when buddy active but chat hidden
See merge request !1095
- - - - -
1 changed file:
- public/javascripts/chat.js
Changes:
=====================================
public/javascripts/chat.js
=====================================
--- a/public/javascripts/chat.js
+++ b/public/javascripts/chat.js
@@ -165,7 +165,7 @@ jQuery(function($) {
if(offset == 0) history.scrollTo({top:'100%', left:'0%'});
else history.scrollTo(offset_container.height());
if (who != "self") {
- if ($(tab_id).find('.history:visible').length == 0) {
+ if ($(tab_id).find('.history:visible').length == 0 || !$('#chat').hasClass('opened')) {
count_unread_messages(jid_id);
}
document.alert_title = name;
@@ -641,6 +641,11 @@ jQuery(function($) {
if(jQuery('#conversations .conversation').length == 0) jQuery('.buddies a').first().click();
jQuery('#chat').toggleClass('opened');
jQuery('#chat-label').toggleClass('opened');
+
+ if($('#chat').hasClass('opened')) {
+ var jid_id = $('#chat-window .conversation:visible').attr('id').replace(/^conversation-/, '');
+ count_unread_messages(jid_id, true);
+ }
}
function load_conversation(jid) {
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/5916905bd33321742806be50e00835138993d4e4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170208/a627f63a/attachment-0001.html>
More information about the Noosfero-dev
mailing list