[Git][noosfero/noosfero][stable-1.7] Merge branch 'chat-label-counter' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Wed Feb 8 16:56:32 BRST 2017


Rodrigo Souto pushed to branch stable-1.7 at Noosfero / noosfero


Commits:
3ff267c6 by Rodrigo Souto at 2017-02-08T18:56:30+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/3ff267c668d56d8a1343b69bc6cb006712f114dc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170208/ab71b52d/attachment-0001.html>


More information about the Noosfero-dev mailing list